Sahih al-Bukhari, Book 5, Hadith 40 (Bukhari 287)

Narrated `Aisha:

Whenever the Prophet (ﷺ) intended to sleep while he was Junub, he used to wash his private parts and perform ablution like that for the prayer.