The Messenger of Allah ﷺ said, "Sneezing comes from Allah and yawning comes from Satan. So when one of you yawns, let him place his hand over his mouth, for when he says 'aah, aah,' Satan laughs from within his belly. Allah loves sneezing and dislikes yawning, so when a man says 'aah, aah' as he yawns, Satan laughs in his belly."
حدثنا ابن أبي عمر حدثنا سفيان عن ابن عجلان عن المقبري
أن رسول الله ﷺ قال العطاس من الله والتثاؤب من الشيطان فإذا تثاءب أحدكم فليضع يده على فيه وإذا قال آه آه فإن الشيطان يضحك من جوفه وإن الله يحب العطاس ويكره التثاؤب فإذا قال الرجل آه آه إذا تثاءب فإن الشيطان يضحك في جوفه
[Sahih]. Bukhari also narrated it in the Book of Manners, chapter on what is desirable regarding sneezing and what is disliked regarding yawning, hadith no. 6223, from the hadith of Maqburi, through the same chain.