Methadone is a long-acting opioid medication used primarily for pain management and as part of opioid addiction treatment programs. It works by binding to the same receptors in the brain as other opioids, reducing withdrawal symptoms and cravings in individuals addicted to heroin or prescription painkillers. Methadone is also effective for managing chronic pain due to its prolonged duration of action.