In his book Man Have I Got Problems, the late David Wilkerson said we should "starve a sin." I know someone who has a serious medical condition that she keeps at bay by "starving" it of sugar in her diet, so I like this concept of "starving a sin." The advice also reminds me of a cute children's book by Dick Gackenbach titled Harry and the Terrible Whatzit, which teaches children (subliminally) that a fear will starve and shrink when we don't let it have authority in our lives.
Most of all, experience proves to me that Wilkerson is right. Just as any sin pattern can be "fed" and worsened by indulging it, it can be "starved" by swiftly cutting off its oxygen. We do that by getting in the habit of swiftly saying no to it in the name of Jesus. When we do that, then the bad thought that popped into our mind is not only not a sin but is a temptation vanquished! Charles Spurgeon wrote in a collection of devotionals that if you have a thought you hate, it's not your thought. It's Satan harassing you. Get rid of the thought immediately! Do like little Harry with his broom against the Whatzit and watch the thing shrink.
I have a friend who was tempted to answer another friend harshly, out of jealousy. She recognized the spiritual issue right away and so she put to death the ungodly impulse (it's amazing how much that really does feel like dying) and responded instead with a gracious word. She told me the blessing in her soul was immediate. It was the Spirit's confirmation that she had obeyed and passed that little test. These are precisely the trials Peter talks about (1 Peter 1:6-7) that God sends as opportunities to prove our faith as gold.
Starve a sin. It will shrink, shrink, shrink. Satan's only power is the power of the bluff. Ask Harry.