It is important for you to understand that you weren't born with an addictive behaviour and nobody gave it to you, however difficult your situation; it took you a lot of effort and practice to get trapped by such a bad habit. Understanding how this happened will help you overcome this behaviour.
A trigger leads to a thought or craving (l want a drink, some cocaine, to gamble, to have sex, to eat), which builds into an urge (l must have a drink, some cocaine, etc.). Once we use or do, we feel better or normal, but only for a while. This relief or pleasure reinforces this pattern and strengthens the habit. This is the Problem of Immediate Gratification, or PIG.
The problem with the PIG is that immediate gratification often appears to be much more desirable than healthier, delayed rewards. Repeating the pattern reinforces the PIG. Every time we give into an urge, we strengthen the pattern. The next urge comes more quickly and more forcefully. More - and less important - events, thoughts, feelings, and other life stuff causes you discomfort, which triggers more cravings, resulting in more urges, which leads to more using.
The minor stresses that earlier in your life you dismissed as annoying are now major issues in your mind, giving you a "reason" to use. Over time you need more of your addictive behaviour to find relief, so you may start looking for or inventing triggers to have an excuse to use. You may even create urges so that you'll have an excuse to act out.
The more you repeat this pattern, the bigger the PIG grows.
You may feel like you can't escape this cycle of addictive behaviour and that you're doomed to repeat it forever. But there is hope; millions of people have permanently stopped their compulsive behaviours and moved on to live satisfying lives. It happens every day!