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.”
This is a command to Muslim men that they should not lustfully look at women (other than their own wives); and in order to prevent any possibility of temptation, they are required to cast their glances downwards. This is known as “hijab of the eyes”.
Then in the next verse, Allah commands the Prophet to address the women:
قُلْ لِلْمُؤْمِنَاتِ يَغْضُضْنَ مِنْ أَبْصَارِهِنَّ وَ يَحْفَظْنَ فُرُوْجَهُنَّ...
“Say to the believing women that: they should cast down their glances and guard their private parts (by being chaste)…”