[Machine] The Prophet ﷺ would sometimes perform the Witr prayer before going to sleep, and sometimes after sleeping. He would also sometimes perform ablution before going to sleep, and sometimes he would sleep before performing ablution after sexual impurity.
كَانَ النَّبِيُّ ﷺ رُبَّمَا أَوْتَرَ قَبْلَ أَنْ يَنَامَوَرُبَّمَا أَوْتَرَ بَعْدَ أَنْ يَنَامَ وَرُبَّمَا اغْتَسَلَ قَبْلَ أَنْ يَنَامَ وَرُبَّمَا نَامَ قَبْلَ أَنْ يَغْتَسِلَ مِنَ الْجَنَابَةِ