Not only do you need to know the conditions that give rise to the objectionable behavior, but you need to understand the learning principles at work and the needs being met. There is evidence that many former addicts inadvertently make decisions that put them back into risky situations. Especially important here is learning to meet one's needs in an acceptable way. Find another way, instead of the compelling habit, to deal with loneliness, guilt, inferiority, stress, boredom, etc. You will also need to learn skills for coping with unavoidable low and moderate-risk situations.
Constant vigilance is needed.
For example, almost every drug user is a smoker or former smoker. Quitting smoking may lead to eating more. So you not only need to guard against relapse but also the development of a new addiction. When we have an overpowering bad habit that runs amuck and out of control, surely it's wise to weaken if not destroy it. One way is to simply expose oneself to the situations that give rise to the urge and resist the temptation to give in.