If you're serious about stopping then the best way is to remove your triggers and access:
Drugs: delete and block dealers, hell format your phone and change your number, don't interact with fellow users
Booze: stay out of liquor stores, don't "go out" for a few weeks until you can handle it
Cigs: stop buying them and don't go out drinking for a while
Porn: install parental controls on your PC's and phones, set a complicated password and lose it, chuck all mags and DVD's
Food: never shop when hungry and stay out of the junk aisles completely, use a list that you make after eating in the evening, anything not on the list does not go in the trolley, don't go to fastfood or restaurants.
This is obviously for the "casual addict", the one that goes ooh I may be drinking a bit much lately... If you're mainlining heroin into your toes then get professional help.
Main advice is cold turkey yourself for a while, a "bit" here and there in the first few months generally leads to a full relapse.
YMMV