In my experience, and I don’t know if the same applies to everyone, many small urges can build up throughout the day, to the point where they can hit you very hard, almost without warning.
I was able to get past this by developing a close connection with Hashem, but often times I would play an engaging video game, or get up and converse with people to remove myself from a very bad urge.
It would seem that each person might find their own strategy through trial and error, and love of their Creator. Find something that prevents you from acting on your urges by removing the powerful thoughts. This could be talking with people, taking a walk, eating a hearty meal, playing a game, or anything in between.
But the most important thing, is to not give up!
A Tzaddik falls seven times and continues to rise. I know it is said quite often on this site, but it is simply the truth.
When I was struggling, and falling everyday, I said to Hashem, ‘Baruch Hashem, for everything is good. My giving in to desire today was simply a small hiccup, because I WILL overcome this addiction. It may take my a day, it may take me 100 years, but even if I have to lose everything in the process, I WILL overcome P&M. So in this moment, where I have resigned myself to Teshuva, let me be close with You.’
Indeed, there is a story in Gemara. Rav Yochanan went in to visit someone who was afflicted, and asked him, ‘Is your affliction dear to you? The Rabbi responded, ‘I don’t want it, nor it’s reward!’ And Rav Yochanan placed his hand upon him and removed his affliction. For one cannot get out of jail on his own.
May Hashem illuminate your path to freedom.