Abu Hurairah reported,

The Prophet ﷺ said, "Satan ties three knots at the back of the head of one of you when he sleeps, striking each knot with the words, 'You have a long night ahead, so sleep on.' If he wakes and remembers Allah, one knot is undone. If he performs ablution, another knot is undone. If he prays, the last knot is undone, and he begins his morning energetic and in good spirits. Otherwise, he begins his morning ill-tempered and lazy."

Muslim 1819

Sahih

حدثنا عمرو الناقد وزهير بن حرب قال عمرو حدثنا سفيان بن عيينة عن أبي الزناد عن الأعرج

عن أبي هريرة

يبلغ به النبي ﷺ يعقد الشيطان على قافية رأس أحدكم ثلاث عقد إذا نام بكل عقدة يضرب عليك ليلا طويلا فإذا استيقظ فذكر الله انحلت عقدة وإذا توضأ انحلت عنه عقدتان فإذا صلى انحلت العقد فأصبح نشيطا طيب النفس وإلا أصبح خبيث النفس كسلان

مسلم 1819صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Travelers' prayer and its shortening
Chapter
One who slept the entire night until morning
Numbering
Darussalam 1819
Muslim 1819