Sayyiduna Jabir (may Allah be pleased with him) narrates that the Prophet (peace and blessings be upon him) said: "Whenever any male or female sleeps, a rope is tied on his head in which three knots are tied. If a person wakes up and remembers Allah Almighty, one knot comes undone; if he gets up and performs ablution, another knot comes undone; and if he gets up and goes to the prayer, all the knots come undone."
This narration was recorded by Imam Ahmad and Imam Abu Ya'la, and they recorded these additional words: "And he is in an energetic state, having attained good. And if he stays asleep and does not remember Allah Almighty until morning comes, his knots become heavy." The narrators of this narration are the narrators of the "Sahih".
This narration was recorded by Imam al-Tabarani in al-Mu'jam al-Awsat, and he recorded these additional words: "If he wakes up, Satan says to him: 'Rest, the night is very long, stay asleep.' Then Satan ties the knot upon him."