When the Prophet ﷺ wished to eat or sleep while in a state of major ritual impurity, he would perform ablution.
حدثنا مسدد حدثنا يحيى حدثنا شعبة عن الحكم عن إبراهيم عن الأسود
أن النبي ﷺ كان إذا أراد أن يأكل أو ينام توضأ تعني وهو جنب
Muslim narrated it in Menstruation, chapter on the permissibility of a person in a state of major ritual impurity sleeping and the recommendation of wudu for him... etc, no. 305, from the hadith of Shubah. In the version of Amr bin Ali Fallas found in Nasai, no. 256, it reads, "He performed wudu as he would for prayer."