The Messenger of Allah ﷺ, when he wished to be intimate with one of his wives while she was menstruating, would instruct her to wrap a cloth around her waist, then he would be intimate with her.
حدثنا محمد بن العلاء ومسدد قالا حدثنا حفص عن الشيباني عن عبد الله بن شداد
أن رسول الله ﷺ كان إذا أراد أن يباشر امرأة من نسائه وهي حائض أمرها أن تتزر ثم يباشرها
Bukhari narrated it in Kitab al-Hayd, chapter "Mubasharat al-Haid" (Being intimate with a menstruating woman), no. 303, and Muslim in Kitab al-Hayd, chapter "Mubasharat al-Haid fawq al-Izar" (Being intimate with a menstruating woman above the waist-wrapper), no. 293, from the hadith of Shaybani, by the same route.