I usually do several things for my addictions.
The only addiction I developed was to inhalants, although I feel like I actually used them because I wanted to have a cardiac arrest.
I used several methods to stay away from inhalants:
1. Surrounding myself with people: I usually use inhalants when I'm alone, so I try to be with my family all the time to avoid using them.
2. Make it difficult: I try to make buying inhalants difficult. When I used inhalants, it was easy to access them because I lived at my aunt's house and there was a pharmacy nearby where I could buy them. Currently, being with my family makes it more difficult to access inhalants because there are no pharmacies nearby and I'm too lazy to walk too far.
3. Make it unpleasant: Since inhalants are usually depressants/dissociatives, sometimes I used to have unpleasant hallucinations and no longer felt like using inhalants. With alcohol, this can be done with a hangover, as the hangover (in my case) takes away my desire to drink alcohol again.
4. Replace it with other things: when I manage to get to a pharmacy or supermarket, what I do is avoid looking at inhalants (in this case, deodorants and air fresheners) and instead buy something I like to replace the desire to consume inhalants. In this case, I usually buy chocolates or snacks.
5. Avoid anything that motivates you to consume substances: In this case, what I did was eliminate all types of inhalants in my house (solvents, deodorants, air fresheners, paints, etc.) to avoid the temptation to consume them.
Another thing I do is avoid images on the internet that show any type of product that can be used as an inhalant. It happens to me with deodorant ads, and I usually use an ad blocker.
6. This doesn't usually happen to me with inhalants, but it applies to alcohol. If you're offered alcohol somewhere, just say "I don't drink alcohol." Don't say things like "I don't drink now, I used to drink before"; because unconsciously you're saying that you consumed alcohol in the past, and the point is to deceive your mind and make it believe that you never drank alcohol and don't like to drink.