I am a heroin addict. I've been using it since I was 13 years of age. The only time I am not strung out is when I am in prison. How can I live a clean life out here in society?
You can do it, but it will be hard work. Look on this moment as the start of the rest of your life.
Some people get a lot of benefit from attending NA meetings. NA has a set program that's been tested by time, and has worked for many thousands of people.
Since you've been a user for all your adult life, you may have difficulty imagining what things will be like when you're clean. At the moment, perhaps you only have a negative goal: you know what you want to get away from. So, design a positive goal: what you want to move into. As specifically and vividly as possible, make up a story about yourself in the future. It is a film script with you as the hero. What are you doing? Where do you live? Who are your contacts? Where is your money coming from, what are your passions...stuff like this. The more detailed and specific this film script is, the more likely you will be able to achieve it. Make it realistic, not something airy-fairy full of wishful thinking. Then set in place actions to realize it.
One thing that drags people down is returning to their old circles. Chances are that most of your old friends and contacts are users too. Find new friends who are clean. I've mentioned NA. Or join a church, and volunteer for good works for whatever cause takes your passion. It's not too late to start on a sport. Seek an honest job; anything will do at the start. When you are ready, catch up on the education you've missed out on.
As far as the specifics of getting off the drugs, read my page on stopping smoking. The tools I describe there will work for any substance, not just for cigarettes: http://anxietyanddepression-help.com/stopsmoking.html