A war with one's inclination
Dr / Rabbi Yitzchak Twersky from Jerusalem once described to me his approach in helping people deal with these difficult issues.
Our sages call the fight with the evil inclination "Milchemes Hayetzer" which means "a war with one's inclination". They don't call it an "argument" or a "fight" with the inclination, but rather a "war". What we can learn from this is that military tactics are necessary in the struggle with the evil inclination.
In a war, if the other side is stronger and you do battle face to face, you will surely lose. The terrorists world-wide have learned this lesson well. They know that they stand no chance against the great armies of the west. So how are they so successful in creating upheavals and overthrowing great and powerful governments? Guerilla warfare. They don't do battle face to face with powerful armies. They know that if they did that they would be slaughtered. Instead, they learn their enemies weak points and where their enemy is going to be at set times, and they pre-empt them. They spy on the enemy, learn their tactics and fight them where the enemy is vulnerable. They ambush the enemy before the enemy has a chance to realize what has happened. That is their secret to success.
The same theory applies to fighting the evil inclination. He is stronger than us, and if we fight him head on we don't stand a chance. Instead we need to employ Guerilla tactics. We start by asking ourselves, "how has the evil inclination/addiction been so successful until today? How does he get me to fall? In what ways does my mind think in the various situations that I find myself in? In what habitual ways have I learned to scan my surroundings? How is my mind used to thinking and processing information? In which scenarios does it happen the most, in what moods am I in when it happens, in what situations do I start to slip?"
Once we learn the way the evil inclination works with us, we can start to pre-empt him. We can prevent him from fighting us head on. We now realize how he has been so successful until now and in what ways he used to get us to fall, and we start to avoid those situations. We can already predict in advance the way our minds will think in given scenarios, and we can be ready for it. We learn to make fences for ourselves to avoid head-on fights.
This is a powerful approach to winning this difficult battle and often, a good therapist can help a person work this all out. But even just knowing this secret is already a good start on the journey to ultimate success.