I asked Ayesha about the witr prayer of the Messenger of Allah ﷺ, and she mentioned the hadith.I then asked, "What did he do when he was in a state of major ritual impurity? Would he bathe before sleeping, or sleep before bathing?"She replied, "He did both. Sometimes he would bathe and then sleep, and sometimes he would perform ablution and then sleep."I said, "Praise be to Allah, who made the matter accommodating."
سألت عائشة عن وتر رسول الله ﷺ. فذكر الحديث قلت: كيف كان يصنع في الجنابة؟ أكان يغتسل قبل أن ينام أم ينام قبل أن يغتسل؟ قالت: كل ذلك قد كان يفعل. ربما اغتسل فنام، وربما توضأ فنام قلت: الحمد لله الذي جعل في الأمر سعة.
Muslim narrated it in "Menstruation" (307) from Qutayba bin Saeed, who said, Layth told us, from Muawiya bin Salih, from Abdullah bin Abu Qays, who mentioned something similar. This hadith will also come up, in separate parts, in the chapters on night prayer and Witr prayer.