An addiction is not a response to inner pain or turmoil. An addiction is any formed habit where you experience a large dopamine spike in anticipation of a reward. Understanding what an addiction actually is, and then being mindful of the urges that your addiction produces and the processes behind them, is the most powerful way to manage them when they lead to undesirable results. Doing so allows you to reason out what is occurring in your body, and then break out of the urge by severing the stimulus from your automated response to it. There’s also the option of modifying your environment to avoid triggers, ie. if you need to get work done that doesn’t require the use of a computer or access to the internet, creating or moving to a space where you don’t have ready access to a computer and gaining access to a computer would require a significant investment of time and energy is a very effective way to decrease the willpower needed to reject your urges when they arise.
But let’s be clear; addiction is a natural function of the brain and actually an extremely useful and powerful tool, not the demon that everyone makes it out to be. The real problems occur because, due to technological advances, we now have easy access to a multitude of things that are extremely unhealthy for us: refined drugs, refined foods (especially sugars), refined alcohol, and unfettered access to novel stimuli (video games, social media, youtube videos, gambling, porn, etc.). As such, unlike, say, a century ago, we now need to be very mindful of ourselves and the products we consume, otherwise it’s very trivial for us to stumble into a pitfall and become obese/diabetic or destroy our liver or spend all of our time on unproductive activities, whereas before, during, say, the industrial era or modern era, we could entrust ourselves to the routines and drives our brain creates for us and spend all of our mental energies and willpower on pursuing new, constructive activities and habits.
If you’re really committed to breaking an addiction, it’s nice to know that it only takes about 1-2 weeks of mindfulness and abstinence to break it and significantly reduce the number and intensity of urges you experience, however once the addiction is initially formed, you will continue to experience urges intermittently for the rest of your life, depending on your exposure to environments or triggers associated with that addiction, or even sometimes just randomly. At that point, it’s just a matter of continued commitment, though, and understanding that a relapse is not a terrible thing, as long as you have the mindset that an addiction you’ve broken once can be broken again, and usually more easily the 2nd+ time around.