Jabir bin Abdullah reported,

The Prophet ﷺ saw a woman, so he went to his wife Zaynab while she was tanning a hide. He fulfilled his need with her, then went out to his companions and said, "A woman approaches in the form of a devil and turns away in the form of a devil. So when one of you sees a woman, let him go to his wife, for that will repel what is in his heart."

Azami 6427

Sahih

عن جابر بن عبد الله

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

الأعظمي 6427صحيح
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 6427 (2nd edition)
Azami 6427