Abu Hurairah reported,

The Messenger of Allah ﷺ said, "Satan ties three knots at the back of the head of any one of you when he sleeps. At each knot he strikes, saying, '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, all the knots are undone, and he begins his morning energetic and in good spirits. Otherwise, he wakes up ill-tempered and lazy."

Bukhari 3269

Sahih

حدثنا إسماعيل بن أبي أويس قال حدثني أخي عن سليمان بن بلال عن يحيى بن سعيد عن سعيد بن المسيب

عن أبي هريرة رضي الله عنه

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

البخاري 3269صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Beginning of creation
Chapter
Description of Iblis and his soldiers
Numbering
Darussalam 3269
Bukhari 3269