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