An illness that has become chronic, like the habit of wrong-doing that has become ingrained is very hard to heal. If after that, as very often happens, the habit turns into second nature, a cure is out of the question.
So the ideal would be to have no contact with evil. But there is another possibility: to distance yourself from evil, to run away from it as from a poisonous snake, once you have experienced it.
I have known some unfortunate people who in their youth let themselves slide into evil habits which have held them enslaved all their lives. Like pigs wallowing continually in the mire and becoming increasingly filthy, such sinners as these multiply their shame every day with fresh sins.
So blessed is the one who has never thought of evil. However, if through his wiles, the suggestions of the Enemy have found a foothold in your heart, do not remain inactive in the toils of sin.
Be careful not to be utterly overcome by it. If the sin is already weighing you down, if the dust of riches has already settled on you, if your soul has been dragged right down by attachment to material things, then before you fall into utter ruin get rid of the heavy burden. Before the ship sinks, follow the example of sailors and cast overboard the possessions you have accumulated overmuch.
Saint Basil the Great
Commentary on Psalm 1.