Umar bin Khattab mentioned to the Messenger of Allah ﷺ that he sometimes became in a state of major ritual impurity during the night. The Messenger of Allah ﷺ said to him, "Perform ablution, wash your private part, then sleep."
حدثنا عبد الله بن مسلمة عن مالك عن عبد الله بن دينار
أنه قال ذكر عمر بن الخطاب لرسول الله ﷺ أنه تصيبه الجنابة من الليل فقال له رسول الله ﷺ توضأ واغسل ذكرك ثم نم
Bukhari narrated it, Ghusl, chapter on a person in a state of major impurity performing wudu then sleeping, no. 290, and Muslim, Hayd, etc., no. 306, from the hadith of Malik through this chain, and it is in the chapter on the permissibility of a person in a state of major impurity sleeping and the recommendation of wudu for him, in Muwatta (Yahya), 1/47, and the narration of Qanabi, pp. 58, 59.