It is narrated from Sayyiduna Abu Sa'id al-Khudri (may Allah be pleased with him) that he would become junub (in a state of major ritual impurity) during the night and want to sleep, so the Messenger of Allah (peace and blessings be upon him) commanded him to perform ablution and then sleep.
Hadith Referenceمسند أبي يعلى الموصلي / من مسند أبي سعيد الخدري / 1365
Hadith Takhrij«قال سعيد بن محمد السناري: صحيح» «أخرجه سنن ابن ماجه برقم: 586، مسند ابویعلیٰ ترقیم الاثری: 1360»