Eat well, drink lots of water and sleep well and exercise. Maybe some vitamins and 5HTP would help you recover if you've been hitting the drugs hard. I found the most useful were fish oil for good skin and other benefits, B Vitamins for stress and Vitamin C and garlic pills for your immune system. This keeps your body in good shape and looking good which helps your mind feel good. A healthy body goes a long way to thinking positively.
Exercise: it's lots of fun, a great waste of time and a good way to meet people. My favourites are:
-> Yoga because it is low impact and calming, stretching, while being a good work out.
-> Running or walking : getting out of the house, gives you some time to think but also some time to get away from problems or people causing you worries. Interesting stuff to look at and think about, music is a good companion.
-> Swimming : in a pool or in the ocean if it's the right season. It's winter down here in New Zealand so that's out for a while.
-> Weights : Get your body in shape, get rid of some stress and meet some gym people. If you have self-esteem issues like I used to, this can be a great help.
Meditation : You might even achieve enlightenment if you can stick at it but has a lot of earthly benefits too

Look for a how-to guide on the net or Bluelight. This helps you see problems in perspective and without the frantic, terrifying nature they can sometimes take on.
I don't know much about opiate addiction or the problems of withdrawal. I imagine the psychological addiction will be the hardest kick. Get yourself busy with your life and try to make goals, even if they are simple. Achieve them and move on to harder things. See a psychologist if you are feeling up to it, they give you perspective and it is always nice to have someone non-judgemental to talk to. Tell them anything and everything you feel comfortable with.
LOVE, and understanding Jono