“If one of you yawns – according to another report: whilst praying – let him suppress it as much as he can, for the Shaytaan comes in.”
“Yawning comes from the Shaytaan, so if one of you feels the urge to yawn, let him suppress it as much as he can, for if one of you says ‘ha’ (the sound made when yawning), the Shaytaan laughs.”
Shaykh Muhammad ibn Saalih al-‘Uthaymeen (may Allaah have mercy on him) was asked: I am a young religiously-committed man, twenty-two years old. I suffer from a problem which I hope you will help me to get rid of. When I start to pray, I start yawning unintentionally. This problem is with me even when I recite Aayat al-Kursiy in particular. I do not know of any reason for that. I yawn ten times in one prayer. I hope that you can advise me. He replied: Yawning comes from the Shaytaan as the Prophet (peace and blessings of Allaah be upon him) told us. Just as the Shaytaan tries to gain power over the one who is praying by whispering into his heart and throwing ideas into his mind, so too he may try to gain power over a person by means of yawning, so he yawns a great deal and that distracts him from his prayer. If anyone experiences that, let him do what was enjoined by the Prophet (peace and blessings of Allaah be upon him), such as suppressing it as much as he can, and if he cannot, then let him place his hand over his mouth so that he will not give the Shaytaan any way to reach him. He should strive to come to prayer when he is energetic and active, and he should ask Allaah to protect him against what is happening to him in his prayer. If he asks Allaah sincerely and does whatever he can to rid himself of this problem, Allaah says (interpretation of the meaning): “And when My slaves ask you (O Muhammad) concerning Me, then (answer them), I am indeed near (to them by My Knowledge). I respond to the invocations of the supplicant when he calls on Me (without any mediator or intercessor). So let them obey Me and believe in Me, so that they may be led aright”
https://islamqa.info/en/72313