The Path of Safety From the Trial and Temptation (Fitnah) of Women
Question :
I am a young man of nineteen years and not married and I am much affected by the beauty of women. What should I do so that I may keep away from women, because it is women who claim my attention, so that I think of them all the time?
Answer:
You must avert your gaze from looking at women and stop thinking about them and remember. what Allah has promised to the chaste people, and those who abstain from forbidden deeds. You must also marry as soon as possible, because that makes it easier to avert one's glance and is a greater protection for the private parts. Thus these thoughts will be stopped and you will be able to confine yourself to what is permissible and lawful. And Allah knows best.
Source:
Ibn Jibreen.
Fatawa Islamiyah, Vol. 5 Page 168