There are several threads which might weave together to form addictions. One is the physical response to the stimulus, commonly rooted in hormonal releases. Drugs, sugar, sex and gambling are addictive because they lead to release of endorphins, the "feel good" hormones. Sugar (and all carb-dense foods), alcohol, and drugs may trigger additional "pleasant" physical responses. The body responds to these "good-feeling" stimuli by creating cravings for more.
A second is the physical habits and patterns. Often addictions are strengthened simply by repeating habits that have no particular benefit, or, having been started for good reasons, become ends in themselves.
A third is relational associations. People drink and smoke in company, and associate the good things of relationships with the drink or drug. People eat sugary breakfast as children and look to recreate that simplicity and innocence by eating similar c**p as adults.
A fourth is the mental patterns, which interleave good self-talk with very negative self-talk. The latter is often common in the later stages of addiction and the earlier stages of recovery.
A fifth is, of course, demonic infestation. Our spiritual enemies are all too eager to capitalize on our physical weaknesses and add to them condemnation, hopelessness, self-disgust, and worse. Often the most negative thoughts that addicts experience aren't originating in their own minds.
A sixth (which my wise wife added) is that addictions are often a response to a physical or emotional trauma. Face, understand, and deal with the trauma, and you might undermine the addiction.
The good news is that Jesus knows all of this in far more technical and personal detail, and He desires to see His children set free. He will help you, so involve Him in every step of the process. His timeframe may not match yours though, so be patient with yourself.
You might do well to seek counselling from an experienced pastor, who may also recommend addiction-specific treatment. If you really want to be free of this, don't be too shy or too proud to ask for help in real life.