Language:
كتاب بدء الخلق
59  
Beginning of Creation
(11)
Chapter: The characteristics of Iblis (Satan) and his soldiers
(11)
باب صِفَةِ إِبْلِيسَ وَجُنُودِهِ
Sahih al-Bukhari 3269

Narrated Abu Huraira:

Allah's Messenger (ﷺ) said, "During your sleep, Satan knots three knots at the back of the head of each of you, and he breathes the following words at each knot, 'The night is, long, so keep on sleeping,' If that person wakes up and celebrates the praises of Allah, then one knot is undone, and when he performs ablution the second knot is undone, and when he prays, all the knots are undone, and he gets up in the morning lively and in good spirits, otherwise he gets up in low spirits and lethargic."

حَدَّثَنَا إِسْمَاعِيلُ بْنُ أَبِي أُوَيْسٍ، قَالَ حَدَّثَنِي أَخِي، عَنْ سُلَيْمَانَ بْنِ بِلاَلٍ، عَنْ يَحْيَى بْنِ سَعِيدٍ، عَنْ سَعِيدِ بْنِ الْمُسَيَّبِ، عَنْ أَبِي هُرَيْرَةَ ـ رضى الله عنه ـ أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ ‏ "‏ يَعْقِدُ الشَّيْطَانُ عَلَى قَافِيَةِ رَأْسِ أَحَدِكُمْ إِذَا هُوَ نَامَ ثَلاَثَ عُقَدٍ، يَضْرِبُ كُلَّ عُقْدَةٍ مَكَانَهَا عَلَيْكَ لَيْلٌ طَوِيلٌ فَارْقُدْ‏.‏ فَإِنِ اسْتَيْقَظَ فَذَكَرَ اللَّهَ انْحَلَّتْ عُقْدَةٌ، فَإِنْ تَوَضَّأَ انْحَلَّتْ عُقْدَةٌ، فَإِنْ صَلَّى انْحَلَّتْ عُقَدُهُ كُلُّهَا، فَأَصْبَحَ نَشِيطًا طَيِّبَ النَّفْسِ، وَإِلاَّ أَصْبَحَ خَبِيثَ النَّفْسِ كَسْلاَنَ ‏"‏‏.‏
Reference : Sahih al-Bukhari 3269
In-book reference : Book 59, Hadith 79
USC-MSA web (English) reference : Vol. 4, Book 54, Hadith 491
  (deprecated numbering scheme)