"When you go out to war against your enemies" [Ki Teitzei 21:10]
"The most difficult war of all" remarked the Chofetz Chaim, "is man's war against his yetzer hara."
In his youth, R' Yaakov Yisrael Kanievsky [the Steipler Gaon] was conscripted into the Russian army.
It was not easy serving in the Russian army. He was surrounded by numerous anti-Semites and he often had to stand guard in sub zero temperatures.
Despite the difficult circumstances, the Steipler used great cunning and devised various strategies that enabled him to observe the Sabbath.
It was so cold outdoors that whoever was on guard duty was given a special, thick coat to wear during his shift. But there was only one such coat, so the soldiers took turns wearing it.
One Shabbos eve, when the Steipler came to do his guard duty, the soldier who was wearing the coat took it off and, instead of handing it to the Steipler, hung it on a tree.
The Steipler now stood trembling in the freezing cold, and he was unsure as to what he should do. It was already Shabbos, and removing an item from a tree on the Sabbath is forbidden. On the other hand, without his coat he would freeze.
Five minutes, he thought. Let me see if I can bear not wearing the coat for just five minutes. If, after five minutes, I feel as if I simply cannot stand the cold, then I will retrieve the coat; after all, this is a life-threatening predicament.
Five minutes passed, as the Steipler stood shivering in the bitter cold. Another five minutes, he thought. I'll wait five more minutes and then I'll get the coat.
Another five minutes passed, then another, and yet another, until the night had passed and the guard on the next shift came to relieve him.
The Steipler had not moved from his place the entire night, nor had he transgressed any of the holy day's sanctified commandments.
The war against one's yetzer hara is a most difficult one. The way to emerge victorious is by devising clever strategies. Yet one should not attempt to overcome his yetzer hara all at once, for that will prove to be too difficult. Rather, he should progress gradually, taking a step-by-step approach, as the verse states: "Thoughts conceived in counsel will be firm; wage war with strategies" [Mishlei 20:18]
Source: Rabbi Yisrael Bronstein