ועשו סייג לתורה
(Avos 1:1) Make a fence for the Torah
The Torah instructs us (Vayikra 18:30), "You shall safeguard My commandments." Chazal extrapolate from this verse the requirement to make a fence for the Torah. A fence prevents people from trespassing into restricted places. Accordingly, we are commanded to erect barriers lest we come to transgress the Torah commandments.
In Avos D'Rebbi Nosson (chap. 1, 2) this dictum is discussed at length. It enumerates numerous people who made fences to preclude the possibility of transgressing Torah prohibitions. Among those mentioned is Adam Harishon who told Chava that Hashem forbade them not only to eat from the eitz hadaas but also to touch it. He erected a fence lest Chava sin; for if she can't even touch the tree certainly she won't come to eat from its fruit.
Additionally, Avos D'Rebbi Nosson mentions how Chazal erected a fence, as mentioned in the very first mishna of the first Mesechta (Brachos). Although the Torah allows for the mitzvah of reciting the evening krias shema to be fulfilled at any point of the night, Chazal instructed that it be recited before midnight lest one fall asleep and end up not fulfilling the Torah commandment.
It is clear from the fact that both the written Torah and the oral Torah begin with erecting fences, that taking such precautions is an integral part of the Torah. This idea is highlighted through an interesting story recorded in the Gemara (Sukka 52a).
The great Amorah Abaya once overheard a man tell a woman, "Let's get up early tomorrow and set out on our way together." Abaye thought that he had better follow them to prevent any improper behavior and thus he trailed them for three parsaos (about eight miles) until they reached a fork in the road. At that point, they parted ways and one of them mentioned to the other how it's too bad that they have to part ways since the companionship along the rest of the journey would have been enjoyable.
Abaya lamented that had he been in that man's shoes, he would not have overcome the temptation to sin with the woman. Consequently, he was quite despondent until an elderly man informed him that a person's yetzer hara is directly proportionate to his spiritual level. The temptation is larger when the person is greater. Thus, the man who set out on the journey was not as great as Abaye and as a result did not have the powerful yetzer hara that Abaya did. Therefore, it would be a mistake for Abaya to gauge his spiritual level in comparison to this man's behavior.
The phenomenon mentioned by this elderly man, brings us to a very basic question. If the Tannaim and Amoraim had such a tremendous yetzer hara, why don't we find that they ever faltered with illicit relationships? The answer is that they never slipped because they never walked on ice in the first place! Abaya would never have set out on a journey with a woman! The Tannaim and Amoraim all erected fences and guidelines. Their great fear of the slightest possibility of transgressing any sin prompted them to take all necessary precautions.
Rav Wolbe related that when he was learning in the Mirrer Yeshiva in Poland, the bochurim noticed a habit of the Rosh Yeshiva, Harav Eliezer Yehudah Finkel zt"l. He would never walk on the main street in Mir; rather, he preferred taking the side and back streets of the town. Truth be told, in the early twentieth century there was no pritzus even on the main streets of the city. Nevertheless, the Rosh Yeshiva opted for a more circuitous route since he did not want to take even a remote chance of beholding an inappropriate sight.
Every day we beseech Hashem, "Do not place us in a situation where we will be tested." If we are serious about our entreaty, the very least that we should do is to ensure that we do not put ourselves into similar situations.
Ask yourself and answer: Do I daven in a place which is not conducive to speaking to my Creator? Do I work in an office which has pitfalls of kedusha? Do I bring into my house technology or reading material that present a test for members of my household?