I have been where you have been. I have fought the addiction of drugs, even though I am still at a young age (20).
I can remember doing rockstar lines in the bathrooms at my Middle School with a close buddy of mine. (those were the crazy days... Made our drug money by stealing gum and mechanical pencils from Walgreens and selling them at school LOL)
-Anyways man, best way is to fight the addiction. Rehab is a nice way to do it, but you have that possibility of relapsing, and I don't want that for you.
-You HAVE to tell someone close to you that you know will not judge you by any means. Wife, kids (if old enough), parents, grandparents, really close friends who do not do drugs.
-Try getting a new hobby. Take frequent walks around the neighborhood, or go to your local park and shoot a few hoops to take your mind and time off the addiction.
-Start exercising. That will make the withdrawal process a lot easier, since I KNOW you will have withdrawal symptoms from the coke. Working out will get it out of your system, and get you clean.
Hope this helps, mate. Cheers!