The Messenger of Allah ﷺ said, "At the back of each of your heads, while you sleep, there is a rope with three knots tied in it. When one of you wakes and remembers Allah, one knot is loosened. When he rises and performs the ablution, another knot is loosened. When he stands to pray, all the knots are loosened. He then begins his morning energetic and in good spirits, having gained good. But if he does not do this, he begins his morning lazy and ill-tempered, having gained no good."
حدثنا أبو معاوية حدثنا الأعمش عن أبي صالح
قال رسول الله ﷺ قافية رأس أحدكم حبل فيه ثلاث عقد فإذا استيقظ فذكر الله انحلت عقدة فإذا قام فتوضأ انحلت عقدة فإذا قام إلى الصلاة انحلت عقده كلها قال فيصبح نشيطا طيب النفس قد أصاب خيرا وإن لم يفعل أصبح كسلان خبيث النفس لم يصب خيرا
Its isnad is sahih. It is a repetition of 7306, with similar wording, and we have already indicated its sourcing there. From this route, the route of Abu Muawiya from Amash, it was also related by Ibn Majah, 1329.His saying "the back of the head of one of you" (qafiyata rasi ahadikum), thus it is established in the three manuscript sources, and above the ta in the word qafiyah a fatha is placed in [manuscript] m, with the mark "sahh" (correct) above it, making it accusative as an adverb of place. In [manuscript] k, before it is the word ala, with a taftening mark placed over it indicating that it should be disregarded. As for the narration of Ibn Majah, it reads, "The devil ties a knot at the back of the head of one of you" (yaqidu ash-shaytanu ala qafiyati rasi ahadikum).