Al-Adab Al-Mufrad, Book 40, Hadith 928 (English) ⓘ
Abu Hurayra reported that the Prophet, may Allah bless him and grant him peace, said, "Allah loves the sneeze and dislikes yawning. When one you sneezes and praises Allah, it is a duty for every Muslim who hears him to say, 'May Allah have mercy on you.;' As for the yawn, it comes from Shaytan. When one of you yawns, he should repress it as much as possible. When one of you yawns, Shaytan laughs at him."
حَدَّثَنَا عَاصِمٌ، قَالَ: حَدَّثَنَا ابْنُ أَبِي ذِئْبٍ، عَنْ سَعِيدٍ الْمَقْبُرِيِّ، عَنْ أَبِيهِ، عَنْ أَبِي هُرَيْرَةَ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ: إِنَّ اللَّهَ يُحِبُّ الْعُطَاسَ، وَيَكْرَهُ التَّثَاؤُبَ، وَإِذَا عَطَسَ أَحَدُكُمْ وَحَمِدَ اللَّهَ كَانَ حَقًّا عَلَى كُلِّ مُسْلِمٍ سَمِعَهُ أَنْ يَقُولَ: يَرْحَمُكَ اللَّهُ. فَأَمَّا التَّثَاؤُبُ فَإِنَّمَا هُوَ مِنَ الشَّيْطَانِ، فَإِذَا تَثَاءَبَ أَحَدُكُمْ فَلْيَرُدَّهُ مَا اسْتَطَاعَ، فَإِنَّ أَحَدَكُمْ إِذَا تَثَاءَبَ ضَحِكَ مِنْهُ الشَّيْطَانُ.
also referenced under: Hadith 928 (Reference) & Book 40, Hadith 928 (In-Book)