On what to do when you see something attractive
He went straight to his wife and explained why.
إِنَّ الْمَرْأَةَ تُقْبِلُ فِي صُورَةِ شَيْطَانٍ وَتُدْبِرُ فِي صُورَةِ شَيْطَانٍ فَإِذَا أَبْصَرَ أَحَدُكُمُ امْرَأَةً فَلْيَأْتِ أَهْلَهُ فَإِنَّ ذَلِكَ يَرُدُّ مَا فِي نَفْسِهِ
When one of you is attracted to a woman, let him go to his wife, for that will repel what he feels.
He did not treat the feeling as a failure. He gave a practical instruction for it.
The full narration
Jabir reported that Allah's Messenger (ﷺ) saw a woman, and so he came to his wife, Zainab, as she was tanning a leather and had sexual intercourse with her. He then went to his Companions and told them:The woman advances and retires in the shape of a devil, so when one of you sees a woman, he should come to his wife, for that will repel what he feels in his heart
Source
Ṣaḥīḥ Muslim · 3407
- Agreed upon as authentic (al-Bukhārī / Muslim)