USC-MSA web (English) : Book 9, Hadith 98
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
يَعْقِدُ الشَّيْطَانُ عَلَى قَافِيَةِ رَأْسِ أَحَدِكُمْ إِذَا هُوَ نَامَ ثَلاَثَ عُقَدٍ يَضْرِبُ مَكَانَ كُلِّ عُقْدَةٍ عَلَيْكَ لَيْلٌ طَوِيلٌ فَارْقُدْ فَإِنِ اسْتَيْقَظَ فَذَكَرَ اللَّهَ انْحَلَّتْ عُقْدَةٌ فَإِنْ تَوَضَّأَ انْحَلَّتْ عُقْدَةٌ فَإِنْ صَلَّى انْحَلَّتْ عُقَدُهُ فَأَصْبَحَ نَشِيطًا طَيِّبَ النَّفْسِ وَإِلاَّ أَصْبَحَ خَبِيثَ النَّفْسِ كَسْلاَنَ "
Yahya related to me from Malik from Abu 'z-Zinad from al-Araj from Abu Hurayra that the Messenger of Allah (ﷺ) said, "Shaytan ties three knots at the back of your head when you sleep, and he seals the place of each knot with 'You have a long night ahead, so sleep.' If you wake up and remember Allah, a knot is untied. If you do wudu, a knot is untied. If you pray, a knot is untied, and morning finds you lively and in good spirits, and if not, morning finds you in bad spirits and lazy."
Full reference and source
USC-MSA web (English) : Book 9, Hadith 98 Arabic : Book 9, Hadith 430
View source on Sunnah.com (opens in a new tab)