Muwatta Malik, Book 9, Hadith 98 (USC-MSA) ⓘ
Yahya related to me from Malik from Abu'z-Zinad from al-Araj from Abu Hurayra that the Messenger of Allah, may Allah bless him and grant him peace, 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."
وَحَدَّثَنِي عَنْ مَالِكٍ، عَنْ أَبِي الزِّنَادِ، عَنِ الأَعْرَجِ، عَنْ أَبِي هُرَيْرَةَ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ " يَعْقِدُ الشَّيْطَانُ عَلَى قَافِيَةِ رَأْسِ أَحَدِكُمْ إِذَا هُوَ نَامَ ثَلاَثَ عُقَدٍ يَضْرِبُ مَكَانَ كُلِّ عُقْدَةٍ عَلَيْكَ لَيْلٌ طَوِيلٌ فَارْقُدْ فَإِنِ اسْتَيْقَظَ فَذَكَرَ اللَّهَ انْحَلَّتْ عُقْدَةٌ فَإِنْ تَوَضَّأَ انْحَلَّتْ عُقْدَةٌ فَإِنْ صَلَّى انْحَلَّتْ عُقَدُهُ فَأَصْبَحَ نَشِيطًا طَيِّبَ النَّفْسِ وَإِلاَّ أَصْبَحَ خَبِيثَ النَّفْسِ كَسْلاَنَ " .
also referenced under: Book 9, Hadith 430 (In-Book)