The Messenger of Allah ﷺ said, "Allah loves sneezing and dislikes yawning. When one of you sneezes and says, 'Praise be to Allah,' it becomes a duty upon every Muslim who hears him to say, 'May Allah have mercy on you.' As for yawning, when one of you yawns, let him suppress it as much as he can, and let him not say, 'Haah, haah,' for that comes from Satan, who laughs at him."
حدثنا الحسن بن علي الخلال حدثنا يزيد بن هارون أخبرنا ابن أبي ذئب عن سعيد بن أبي سعيد المقبري عن أبيه
قال رسول الله ﷺ إن الله يحب العطاس ويكره التثاؤب فإذا عطس أحدكم فقال الحمد لله فحق على كل من سمعه أن يقول يرحمك الله وأما التثاؤب فإذا تثاءب أحدكم فليرده ما استطاع ولا يقولن هاه هاه فإنما ذلك من الشيطان يضحك منه
[Its isnad is sahih]. Bukhari also reported it, no. 6223, from the hadith of Muhammad bin Abdul-Rahman bin Abu Dhib, through this same chain. The statement of Ibn Ajlan is sahih from him.