It is narrated from Hazrat Aisha that when the Prophet (peace be upon him) intended to sleep in a state requiring ghusl, he would perform ablution as for prayer, and he said that whoever wishes to sleep in a state requiring ghusl should perform ablution as for prayer.
Hadith Referenceمسند احمد / مسند النساء / 24608
Hadith Gradingحکم دارالسلام:حديث صحيح من فعله، وصحيح لغيره من قوله ابن لهيعة توبع ، راجع: 24083