Following the model of the Chofetz Chaim as regards shmiras halashon, let us briefly outline the basic prohibition and offer guidelines that pertain
to shmiras einayim.
Firstly, as regards the prohibitions: The Torah writes: ,וְלֹא תָתוּרוּ אַחֲרֵי לְבַבְכֶם וְאַחֲרֵי עֵינֵיכֶם אֲשֶׁר אַתֶּם זֹנִים אַחֲרֵיהֶם do not stray after your mind and eyes after which you tend to stray, which means that there are certain areas that we are prohibited from exploring through our mind and eyes. Chazal understand this as referring to inyanei arayos, improper interactions between genders.
As Rabbeinu Yonah writes: “It is stated regarding looking at arayos, ‘Velo sosuru ...’ We are warned against looking at a married woman and other arayos lest this leads to our stumbling with them.”
Another related prohibition is: ,וְנִשְׁמַרְתָּ מִכֹּל דָּבָר רָע Guard yourself from all evil matters, which Chazal interpret as meaning that we must refrain from improper thoughts because they lead to nocturnal tumah.
There are also two other general prohibitions against performing actions that may lead to ervah: אִישׁ אִישׁ אֶל כָּל שְׁאֵר בְּשָׂרוֹ לֹא תִקְרְבוּ לְגַלּוֹת עֶרְוָה , Each and every man shall not draw near to any relative to reveal her ervah; and כְּמַעֲשֵׂה אֶרֶץ מִצְרַיִם אֲשֶׁר יְשַׁבְתֶּם בָּהּ לאֹ תַעשֲׂוּ , Do not act in the manner [of the inhabitants of] the Land of Egypt, where you [formerly] lived.
In addition to these, there is a prohibition stated by the navi prohibiting one from looking at an unmarried woman: בְּרִית כָּרַתִּי לְעֵינָי וּמָה אֶתְבּוֹנֵן עַל בְּתוּלָה , I made a covenant with my eye. Why would I contemplate a maiden?
Thus far we have spoken of prohibitions. The positive commandment of קְדשִׁים תִּהְיוּ , sanctify yourselves, requires that we separate ourselves from arayos, as noted in Rashi there.
The Chofetz Chaim adds that the commandment of אֶת ה’ אֱלקֶֹיך תִּירָא , Fear Hashem, your G-d, requires that we not wantonly disregard Hashem’s mitzvos
by taking the attitude that He is not watching.
Moreover, one who wantonly disregards any mitzvah is subject to an explicit curse, as the Torah writes: אָרוּר אֲשֶׁר לאֹ יָקִים אֶת דִּבְרֵי הַתּוֹרָה הַזּאֹת לַעֲשׂוֹת אוֹתָם , Cursed shall be one who does not uphold the words of this Torah, to perform them, which refers to a person who does not accept the Torah in its totality.