Methadone is part of a category called opioids. It was created by German doctors during World War II. When it arrived in the United States, it was used to treat people with extreme pain. Today, your doctor may use it as part of your treatment for an addiction to heroin or narcotic painkillers.