[Machine] The Messenger of Allah ﷺ used to perform ablution for prayer before going to sleep if he was in a state of janabah (ritual impurity). He would say, "Whoever intends to sleep while in a state of janabah, let him perform ablution for prayer."
كَانَ رَسُولُ اللهِ ﷺ إِذَا كَانَ جُنُبًا وَأَرَادَ أَنْ يَنَامَ وَهُوَ جُنُبٌ تَوَضَّأَ وُضُوءَهُ لِلصَّلَاةِ قَبْلَ أَنْ يَنَامَ وَكَانَ يَقُولُ مَنْ أَرَادَ أَنْ يَنَامَ وَهُوَ جُنُبٌ فَلْيَتَوَضَّأْ وُضُوءَهُ لِلصَّلَاةِ