“Turn from evil and do good; seek peace and pursue it” (T’hillim 34:15)
Whenever we refrain from sinning by “turning away from evil,” Hashem actually considers it as if we were “doing good.” Our Sages say that the first two mitzvot, “I am Hashem, your G-d,” and “You shall have no other gods before Me” were heard simultaneously as a single utterance. By fulfilling the second, we automatically also fulfill the first. The Tikkunei Zohar (22) states that the first commandment is the root of all positive mitzvot, while the second is the root of all negative ones. Therefore, whether we are actively performing Hashem’s will or simply avoiding transgressing it, we are still coming closer to Hashem.
We read in the Midrash that “Whoever sees an indecent thing but does not indulge his eyes will behold the Sh’khina, the Divine Presence… ‘He shuts his eyes from beholding evil… your eyes will see the King in His beauty’ (Isaiah 33:15, 17)” (Vayikra Rabba 23:1). This is an awesome choice Hashem gives us, in that we can either choose to dirty our souls with momentary pleasures or we can enjoy the light of Hashem’s Presence!
Our Sages tell us that in one sha’ah, moment, we can merit Olam HaBa, the World to Come. The word sha’ah, moment, is the same as the word “to turn toward,” as in, “And to Cain… He did not turn, lo sha’ah” (Genesis 4:5). In a single moment, a single turn of our face away from evil, we can merit eternal blessing. Similarly, every good deed also repairs our spiritual vision, enabling us to behold the beauty of the Sh’khina. Hence, whenever we refrain from sinning, Hashem actually considers it as if we were “doing good!”
Based on In All Your Ways: A Guide to Avodas HaShem, Collected Discourses of Rabbi Yaakov Meir Schechter, Avoiding Evil and Doing Good — One and the Same.