«كان إذا أراد أن ينام وهو جنب غسل فرجه وتوضأ للصلاة»
It was the practice of the Prophet (peace and blessings be upon him):
"When he (peace and blessings be upon him) intended to sleep while in a state of major ritual impurity (janabah), he would wash his private parts and perform ablution (wudu) like the ablution for prayer."