Abu Kabsha reported,

The narrator said, the Messenger of Allah ﷺ was sitting among his companions when he went inside, then came out having bathed. We said, "Messenger of Allah, has something happened?"He replied, "Yes. So-and-so passed by me, and desire for women stirred in my heart, so I went to one of my wives and was intimate with her. Do likewise, for among the most virtuous of your deeds is intimacy with what is lawful."

Azami 6428

Hasan

عن أبي كبشة الأنصاري قال:

قال: كان رسول الله ﷺ جالسا في أصحابه، فدخل، ثم خرج وقد اغتسل. فقلنا: يا رسول الله قد كان شيء؟ قال: أجل، قد مرت بي فلانة، فوقع في قلبي شهوة النساء، فأتيت بعض أزواجي فأصبتها، فكذلك فافعلوا، فإنه من أماثل أعمالكم إتيان الحلال.

الأعظمي 6428حسن
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Marriage
Chapter
Rights and duties of the Muslim woman, and good treatment of her
Section
Recommendation for one who sees a woman and feels desire to go to his wife or slave girl to fulfill his need
Numbering
Jami al-Kamil 6428 (2nd edition)
Azami 6428