Methadone may also get used as a pain killer if you had surgery, sustained an injury, or have a long-term illness. A doctor prescribes if you need it for pain. If you are using it for an addiction, you will most likely get it from a treatment program.