Muwatta Imam Malik Book of Purity, Hadith 78
Yahya related to me from Malik from Abdullah ibn Dinar that Abdullah ibn Umar related that Umar ibn al-Khattab mentioned to the Messenger of Allah ﷺ that he would sometimes become junub in the night. The Messenger of Allah ﷺ said to him, "Do wudu and wash your penis, and then sleep."
حَدَّثَنِي يَحْيَى، عَنْ مَالِكٍ، عَنْ عَبْدِ اللَّهِ بْنِ دِينَارٍ، عَنْ عَبْدِ اللَّهِ بْنِ عُمَرَ، أَنَّهُ قَالَ ذَكَرَ عُمَرُ بْنُ الْخَطَّابِ لِرَسُولِ اللَّهِ ﷺ أَنَّهُ يُصِيبُهُ جَنَابَةٌ مِنَ اللَّيْلِ فَقَالَ لَهُ رَسُولُ اللَّهِ " تَوَضَّأْ وَاغْسِلْ ذَكَرَكَ ثُمَّ نَمْ " .