When the Messenger of Allah ﷺ was in a state of ritual impurity and wanted to eat or sleep, he would perform ablution as he did for prayer.
كان رسول الله ﷺ إذا كان جنبا فأراد أن يأكل أو ينام، توضأ وضوءه للصلاة.
Bukhari narrated it in the chapter on ghusl (288) via Layth, from Ubaydullah bin Abu Jafar, from Muhammad bin Abdul-Rahman, from Urwa, from Ayesha, who said, "When the Prophet ﷺ wanted to sleep while in a state of major impurity, he would wash his private parts and perform ablution for prayer."Muslim narrated it in the chapter on menstruation (305) via Layth, from Ibn Shihab, from Abu Salama bin Abdul-Rahman, from Ayesha, that the Messenger of Allah ﷺ, when he wanted to sleep while in a state of major impurity, would perform the ablution he performed for prayer before sleeping.Shuba added, in his narration from Hakam, from Ibrahim, from Aswad, from Ayesha, "And when he wanted to eat or sleep..."In a narration recorded by Abu Dawud (223) and Nasai (257) via Ibn Mubarak, from Yunus, from Zuhri, from Abu Salama, from her, "And when he wanted to eat while in a state of major impurity, he would wash his hands." The wording of Nasai is, "When he wanted to sleep while in a state of major impurity, he would perform ablution, and when he wanted to eat or drink, he would wash his hands, then eat or drink." Ibn Abu Shayba (662) likewise narrated it from Ibn Mubarak.Abu Dawud said, "Ibn Wahb narrated it from Yunus, and he made the account about eating restricted to Ayesha's own statement. Salih bin Abu Akhdar narrated it from Zuhri just as Ibn Mubarak said, except that he said, 'from Urwa or Abu Salama.' Uzai narrated it from Yunus, from Zuhri, from the Prophet ﷺ, just as Ibn Mubarak said."I say, his statement "restricted" means that the account about eating is separate from sleeping. As for the narration of Salih bin Abu Akhdar from Zuhri, Ahmad (24714) narrated it from Sakan bin Nafi, from him, with the wording, "The Messenger of Allah ﷺ, when he wanted to sleep while in a state of major impurity, would perform the ablution he performed for prayer, and when he wanted to eat or drink, he would wash his hands, then eat or drink if he wished," meaning without ablution, as Ibn Mubarak's statement mentioned earlier regarding the difference between sleeping and eating.As for his statement, "Uzai narrated it from Yunus, from Zuhri, from the Prophet ﷺ, just as Ibn Mubarak said," I say, the narration of Uzai was recorded by Ibn Abu Shayba (673) from Isa bin Yunus, from Uzai, from Zuhri, who said, "One in a state of major impurity, when he wants to eat, washes his hands." This is Zuhri's own statement, and it is not a mursal narration mentioning the Prophet ﷺ, and moreover it is restricted to eating without sleeping.Ibn Khuzayma also narrated it (218) through the hadith of Isa bin Yunus, from Yunus bin Yazid Ayli, from Zuhri, from Urwa, from Ayesha, that the Prophet ﷺ, when he wanted to eat while in a state of major impurity, would wash his hands, then eat.It thus becomes clear from these narrations that one in a state of major impurity, if he wants to sleep, must perform the ablution he performs for prayer, unlike eating and drinking, for which washing the hands suffices.