This medicine is used to treat chronic, severe pain. (such as due to cancer). Methadone belongs to the opioid analgesic medication class. It changes how your body perceives and responds to pain by acting on the brain. Use this drug just to treat minor discomfort that will go away in a few days. (such as pain from surgery). This drug should not be used on an as-needed basis. As part of an authorized treatment program, this drug is also used to treat opioid addiction (such as heroin). It aids in the prevention of withdrawal symptoms produced by the discontinuation of other opioids.