In Chapter 24 known as an-Nur (the Light), in verse 30, Allah commands Prophet Muhammad as follows:
قُلْ لِلْمُؤْمِنِيْنَ يَغُضُّوْا مِنْ أَبْصَارِهِمْ وَ يَحْفَظُوْا فُرُوْجَهُمْ, ذَلِكَ أَزْكَى لَهُمْ.
“Say to the believing men that: they should cast down their glances and guard their private parts (by being chaste). This is better for them.”