How to buy methadone online? This medication is used to treat addiction to opioids (such as heroin) as part of an approved treatment program. Methadone belongs to a class of drugs known as opioid analgesics. It helps prevent withdrawal symptoms caused by stopping other opioids.