Treatment works for some people some times. I found that I had a long commute every day for my company to continue to grow and my family to propser. I had given up most drugs but fell for meth as a way to continue to do everything I had to do every day. More interestingly, a lot of people owed me money and most of them could pay in meth. So I started out by telling my wife every time I intended to take it. That went on until I started taking it every day. One Christmas day, I woke up and realized that even on a day in which I had no obligations I couldn't get through it without a line. I proceeded to dump my half oz of crank down the toilet. Except that I couldn't quite manage that. I checked gave the bag to my wife, moved into a motel and checked into rehab. At rehab they told me that I would have to give up drinkinig as well. I have a penchant - When I make an agreement with someone, I keep it if at all possible. My agreement with the rehab place was that I wanted to get better, and I would have to do what ever they said to do to make that happen. They were the experts so I did as they said.
I also bet that I could show everyone that alcohol was not my problem. So I quit, that day, for 5 years, after my 6 month token, I quit going to AA, for me it was stupid, I simply never had a problem drinking.
As far as the meth was concerned? I ate skittles by the pound, chasing it with quarts of Coke.
But many of the folks here have the right idea - you are going to have to give up all of the friends you have who have access to X. Most of them aren't really your friends anyway. The ones who are won't give you any more.
And the second thing, I have talked about before is being lazy. BE LAZY. The hardest part of giving something up is access, and the second is modifying your behaivor - the lazier you are about your drug of choice the easier it is. "Hey DUDE! I got the purest X you can imagine here, it's just five miles away". Lazy will tell you that it is just too far out of your way and too much out of your day. And if you are REALLY crazy - think about going, but only if you don't take your car - walk, better yet, run.
Anyway, that was what worked for me and I believe I've purposefully had meth once afterward, after 20 years thereabouts.
The other thing is - once you start stopping, don't stop stopping but figure that you might fail. Cigarettes had me more than anything else in the world - 26 year 2 pack a day smoker. Two weeks after I quit my wife filed for divorce. I would NOT let that stop me from stopping. I timed my cravings and found that they lasted 7 minutes. I really only had to hold out for 7 minutes. Oh that craving might come back in another 10 but I knew I only had to last 7.
Might work for you as well.
Time them and see.