We focus even more on the problem we want to get rid of. By giving it energy, it grows in our minds. This makes us feel even worse, so we do the behavior again and again to get the "peace, comfort and relief" we need, even though we know there will be consequences. And eventually we develop the belief that we are powerless against it. It's definitely a vicious circle.
Eckhart Tolle said once said “One of the main tasks of the mind is to fight or remove the emotional pain, which is one of the reasons for its incessant activity, but all it can ever achieve is to cover it up temporarily. In fact, the harder the mind struggles to get rid of the pain, the greater the pain”
Consider the view point that it is not that we are powerless against our unwanted habits or addictions, it is that we are so powerful, our thoughts are so powerful that we are actually the one keeping the thing that is unwanted in our lives alive.
By redirecting our thoughts away from the unwanted behavior entirely, and more in the direction of what you want and what makes you feel good, the energy you were giving the unwanted habit starts to lessen.