Lady Aisha (may Allah be pleased with her) said: When the Messenger of Allah (peace and blessings be upon him) was in a state of major ritual impurity (janabah) and intended to eat or sleep, he would perform ablution (wudu).
Hadith Referenceسنن دارمي / من كتاب الاطعمة / 2115
Hadith Takhrijاس روایت کی سند صحیح اور حدیث متفق علیہ ہے۔ دیکھئے: [بخاري 286] ، [مسلم 305] ، [أبوداؤد 224] ، [نسائي 255] ، [ابن ماجه 591] ، [أبويعلی 4522] ، [ابن حبان 1217]
Brief Explanation
(Commentary on Hadiths 2113 to 2115)
From this hadith, it is understood that it is permissible and correct to sleep in a state of major ritual impurity (janabah) before performing the ritual bath (ghusl). Both practices are established from the Messenger of Allah sallallahu alayhi wa sallam: sometimes he would perform the ritual bath and then rest, and sometimes he would suffice with only ablution (wudu) and then sleep.
In several verbal narrations in Sahih Muslim, when the Messenger of Allah sallallahu alayhi wa sallam was asked whether a person in a state of janabah can sleep, he sallallahu alayhi wa sallam replied: “Yes, he can sleep, provided he washes his private parts and performs ablution.”
Imam Nawawi rahimahullah said: The sum of all these ahadith is that it is permissible for a person in a state of janabah to eat, drink, and sleep; there is consensus on this.
According to these ahadith, it is recommended (mustahabb) that if one wishes to eat, drink, or have intercourse again, he should perform ablution and wash his private parts. If he does not do so, it is disliked (makruh), and according to some, performing ablution is obligatory (wajib).
These ahadith also indicate that the ritual bath for janabah is not immediately obligatory; rather, it becomes obligatory when one rises for prayer.