The Prophet ﷺ said, "Allah loves sneezing and dislikes yawning. When one of you sneezes and praises Allah, every Muslim who hears him is obliged to invoke mercy upon him. As for yawning, it is from Satan, so let him suppress it as much as he can, for when he says 'haa,' Satan laughs at him."
حدثنا آدم بن أبي إياس حدثنا ابن أبي ذئب حدثنا سعيد المقبري عن أبيه
عن النبي ﷺ إن الله يحب العطاس ويكره التثاؤب فإذا عطس فحمد الله فحق على كل مسلم سمعه أن يشمته وأما التثاؤب فإنما هو من الشيطان فليرده ما استطاع فإذا قال ها ضحك منه الشيطان