The Prophet ﷺ permitted a person in a state of major ritual impurity, when wishing to eat, drink, or sleep, to perform ablution as he would for prayer.
حدثنا هناد حدثنا قبيصة عن حماد بن سلمة عن عطاء الخراساني عن يحيى بن يعمر
أن النبي ﷺ رخص للجنب إذا أراد أن يأكل أو يشرب أو ينام أن يتوضأ وضوءه للصلاة
[Its chain of transmission is daif]. Abu Dawud also narrated it in Kitab al-Tahara, Bab man qala al-junub yatawadda, Hadith 225, from the hadith of Hammad bin Salama through the same route, and its chain is daif. But the hadith of Muslim, Hadith 22/305, suffices in its place, and this one indicates mere recommendation. See Nayl al-Maqsud, Hadith 222.