From personal experience can say it's near impossible task. Especially if the addiction is worse due to depression. They can have nice quiet period that make everything seem fine only to regress heavily to worse state. It's a grueling process that makes you either cut off ties or or basically semi enable them by not facing the issue head on.
keep them occupied with school, work, career, etc. Need to give them a purpose in life. Sustained addiction is more about the lack of purpose and support system than the effects of drugs.