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.
حدثنا محمد بن رمح المصري أنبأنا الليث بن سعد عن الزهري عن أبي سلمة
كان رسول الله ﷺ إذا أراد أن ينام وهو جنب توضأ وضوءه للصلاة
Recorded by Muslim, in "The Book of Menstruation," chapter "On the Permissibility of a Person in a State of Sexual Impurity Sleeping and the Recommendation of Wudu for Him," etc., no. 305, from Muhammad bin Rumh and others through the same chain.