The Messenger of Allah ﷺ said: 'When any one of you goes to sleep, the Shaitan ties three knots on his head, saying each time: "(Sleep) a long night." If he wakes up and remembers Allah (SWT), one knot is undone. If he performs wudu', another knot is undone. If he prays, all the knots are undone and he starts his day in a good mood and feeling energetic. Otherwise he starts his day in a bad mood and feeling lethargic.'"
قَالَ رَسُولُ اللَّهِ ﷺ إِذَا نَامَ أَحَدُكُمْ عَقَدَ الشَّيْطَانُ عَلَى رَأْسِهِ ثَلاَثَ عُقَدٍ يَضْرِبُ عَلَى كُلِّ عُقْدَةٍ لَيْلاً طَوِيلاً أَىِ ارْقُدْ فَإِنِ اسْتَيْقَظَ فَذَكَرَ اللَّهَ انْحَلَّتْ عُقْدَةٌ فَإِنْ تَوَضَّأَ انْحَلَّتْ عُقْدَةٌ أُخْرَى فَإِنْ صَلَّى انْحَلَّتِ الْعُقَدُ كُلُّهَا فَيُصْبِحُ طَيِّبَ النَّفْسِ نَشِيطًا وَإِلاَّ أَصْبَحَ خَبِيثَ النَّفْسِ كَسْلاَنَ