It is just as impossible for a man to prevent thoughts as it is to stop the wind by spreading one's cloak. That is what an elder told his disciple. Nevertheless there is something essential that can be done. The elder explained it in the following parable: "You are walking along a road and come to a place where there is a restaurant. Enticing odors of food come from the restaurant. But still it rests with you whether you go in and have a meal or pass by." By enticing odors the elder meant involuntary bad thoughts that enter our consciousness. We can stop to examine them: then we "go in"; in other words, we take a liking to them and admit them into our hearts. Thus we have already sinned in our thoughts and hearts. But we can also "pass by," in which case the evil thought or image that passed our consciousness is not considered a sin.
Archbishop PAUL of Finland, The Faith We Hold (SVS Press, 1980), p. 68