Whenever the Messenger of Allah ﷺ wished to sleep while in a state of major ritual impurity, he would perform ablution as he did for prayer. If he wished to eat or drink, he would wash his hands and then eat or drink, if he so desired.
حدثنا سكن بن نافع قال حدثنا صالح بن أبي الأخضر عن الزهري قال أخبرني أبو سلمة بن عبد الرحمن أن
كان رسول الله ﷺ إذا أراد أن ينام وهو جنب توضأ وضوءه للصلاة فإذا أراد أن يأكل أو يشرب غسل كفيه ثم يأكل أو يشرب إن شاء