Sunan Ibn Majah, Book 5, Hadith 1390 (In-Book) ⓘ
It was narrated that Abu Hurairah said: “The Messenger of Allah said: ‘At night Satan ties a rope in which there are three knots to the nape of the neck of anyone of you. If he wakes up and remembers Allah, one knot is untied. If he performs ablution, another knot is untied, and if he gets up to pray, all the knots are untied, so he wakes up energetic and cheerful, he has already earned something good. But if he does not do that, he wakes up bad-tempered, having earned nothing good.”
حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، حَدَّثَنَا أَبُو مُعَاوِيَةَ، عَنِ الأَعْمَشِ، عَنْ أَبِي صَالِحٍ، عَنْ أَبِي هُرَيْرَةَ، قَالَ قَالَ رَسُولُ اللَّهِ ـ صلى الله عليه وسلم ـ " يَعْقِدُ الشَّيْطَانُ عَلَى قَافِيَةِ رَأْسِ أَحَدِكُمْ بِاللَّيْلِ بِحَبْلٍ فِيهِ ثَلاَثُ عُقَدٍ فَإِنِ اسْتَيْقَظَ فَذَكَرَ اللَّهَ انْحَلَّتْ عُقْدَةٌ فَإِذَا قَامَ فَتَوَضَّأَ انْحَلَّتْ عُقْدَةٌ فَإِذَا قَامَ إِلَى الصَّلاَةِ انْحَلَّتْ عُقَدُهُ كُلُّهَا فَيُصْبِحُ نَشِيطًا طَيِّبَ النَّفْسِ قَدْ أَصَابَ خَيْرًا وَإِنْ لَمْ يَفْعَلْ أَصْبَحَ كَسِلاً خَبِيثَ النَّفْسِ لَمْ يُصِبْ خَيْرًا " .
also referenced under: Hadith 1329 (Reference) & Volume 2, Book 5, Hadith 1329 (DarusSalam)