Staying away from things, which lead to adultery
In the Holy Quran, Allah Ta'ala has ordered us to stay away from both adultery and things, which lead to adultery. As given in Surah Noor-
Direct the believing men to keep their eyes always lowered and guard their private parts. That is purer for them. Surely Allah is Well Aware of the (works) which they are busy doing. Surah Noor (24:30)
There is a Hadith in Musnad Iman Ahmed bin Hambal:
Translation of Hadith: It has been narrated on the authority of Hadhrat Abu Hurairah (May Allah be well pleased with him) that the Holy Prophet (Sallallahu alaihi wa sallam) has said: Every part of the body plays its part in adultery. Eyes fornicate and their fornication is seeing. Hands fornicate and their fornication is holding and grasping. Feet fornicate and their fornication is to walk (towards adultery). Mouth fornicates and its fornication is to kiss. The heart desires and the private parts endorse it by fornicating or belies it and stays away from adultery. (Musnad Iman Ahmed bin Hambal, Hadith No. 8572)
There is a Hadith in Mo'jam Kabeer Tabarani and Kanz Ul Ummal:
Translation of Hadith: Hadhrat Ma'aqal (May Allah be well pleased with him) narrates that the Holy Prophet (Sallallahu alaihi wa sallam) said: That a needle of iron should prick your head is better than that you touch a non-Mahram woman. (Mo'jam Kabeer Tabarani, Hadith No. 16880; Kanz Ul Ummal, Hadith No. 13065).
There is a Hadith in Mo'jam Kabeer Tabarani, Jame' Ul Ahadith, Kanz Ul Ummal: