This is the 11627th most frequent Russian word.
желая
"Желая" means "wishing" or "wanting."
The word "желая" here means "wishing" or "desiring" and acts as an adverbial participle modifying "говорил" to provide additional context to the action.
Он говорил, желая убедить нас в своей правоте.
He spoke, wishing to convince us of his correctness.
"Желая" is used as an adverbial participle that describes the intent behind the action of writing the letter.
Она написала письмо, желая объяснить ситуацию.
She wrote a letter, wishing to explain the situation.
In this sentence, "желая" reflects the motive of the teacher while performing the action.