When the Messenger of Allah ﷺ wanted to sleep while in a state of major ritual impurity, he would perform ablution, and when he wanted to eat, he would wash his hands.
أخبرنا محمد بن عبيد بن محمد قال حدثنا عبد الله بن المبارك عن يونس عن الزهري عن أبي سلمة
أن رسول الله ﷺ كان إذا أراد أن ينام وهو جنب توضأ وإذا أراد أن يأكل غسل يديه
Sahih. Abu Dawud narrated it in "Tuhur," chapter "One who is sexually impure eating," h: 223, and Ibn Majah in "Tuhur," chapter "Whoever said washing his hands suffices for him," h: 593, from the hadith of Ibn Mubarak, with this wording, and it is in "al-Kubra," h: 254.Zuhri explicitly stated that he heard it directly, in Sharh al-Sunnah 2/34, and Baghawi said, this is a sahih hadith, and its basis is in Sahih Muslim, h: 305, from the hadith of Zuhri, with this wording.