عَنْ أَبِي هُرَيْرَةَ رَضِيَ اللَّهُ عَنْهُ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ: ((إِذَا نَامَ أَحَدُكُمْ عُقِدَ عَلَى رَأْسِهِ ثَلَاثُ عُقَدٍ بِجَرِيرٍ، فَإِنْ قَامَ فَذَكَرَ اللَّهَ عَزَّ وَجَلَّ، أُطْلِقَتْ وَاحِدَةٌ، وَإِنْ مَضَى فَتَوَضَّأَ أُطْلِقَتِ الثَّانِيَةُ، فَإِنْ مَضَى فَصَلَّى أُطْلِقَتِ الثَّالِثَةُ، فَإِنْ أَصْبَحَ وَلَمْ يَقُمْ شَيْئًا مِنَ اللَّيْلِ وَلَمْ يُصَلِّ أَصْبَحَ وَهُوَ عَلَيْهِ، يَعْنِي الْجَرِيرَ (وَفِي لَفْظٍ: وَإِنْ هُوَ بَاتَ وَلَمْ يَذْكُرِ اللَّهَ عَزَّ وَجَلَّ وَلَمْ يَتَوَضَّأْ وَلَمْ يُصَلِّ حَتَّى يُصْبِحَ) أَصْبَحَ وَعَلَيْهِ الْعُقَدُ جَمِيعًا))
Sayyiduna Abu Hurairah (may Allah be pleased with him) narrates that the Messenger of Allah (peace and blessings be upon him) said: When any one of you sleeps, three knots are tied at the back of his head with a leather cord. If he wakes up and remembers Allah, one knot is untied. If he goes further and performs ablution, the second knot is untied. And if he also performs prayer, the third knot is untied. But if he wakes up in the morning without having gotten up at night and without praying, then he wakes up with the cord still upon him. In one wording: And if he spends the night without remembering Allah, without performing ablution and without praying until morning, he wakes up with all the knots upon him.