I've never done illicit drugs in my life, but have had to stop taking some pretty powerful meds that I was put on to treat OCD, so I have experienced withdrawal. I used to drink alcohol to excess and compulsively self-harm also, and I have managed to limit the former to a manageable level and eliminate the latter.
In my experience, such reward-seeking behaviour was usually the result of me trying to fill a hole in my life; I felt crap about myself, so I looked for a dopamine hit to soothe the pain, whether that was a bottle of vodka or a scalpel. What worked for me to fill this role with a healthier alternative, like exercise.