There is a drug, available on prescription, called naltrexone (sometimes prescribed under the trade name Nalorex) that can help prevent relapse. Naltrexone doesn’t affect mood at all, but it does block all your opiate receptors. This means that if you take heroin, or any other opiate, the naltrexone will stop it having any effect at all. Taking one naltrexone tablet every day will stop opiates having any effect.
Naltrexone treatment cannot start until 7-10 days after you have taken your last opiate. This is because taking naltrexone before opiates are completely out of your system causes instant withdrawals. Never start naltrexone treatment without seeking medical advice.
If you find it hard to stay off but are well motivated some of the time, then naltrexone can be ideal: you can take it when you feel strong and have it in your system ‘protecting’ you when you feel weak.
Sometimes people get their partners to give them the tablets in the morning or they go into a drug service to get them. These are ways of increasing motivation although, in the end, there is no substitute for taking responsibility for yourself. You can use it to build up drug-free time, and experience of difficult situations.
However, once you stop taking naltrexone you will be at very high risk of overdose if you lapse/relapse: injecting heroin after a period on naltrexone often kills.