Opioids are a class of drugs that include the illegal drug heroin, synthetic opioids such as fentanyl, and pain relievers available legally by prescription, such as oxycodone, hydrocodone, codeine, morphine, and many others
. They are commonly prescribed by doctors to treat persistent or severe pain and are used by people with chronic headaches, backaches, and those recovering from surgery or experiencing severe pain associated with cancer
. Opioids work in the brain to produce a variety of effects, including pain relief, and can cause addiction or opioid use disorder if misused
. Some examples of opioids include morphine, heroin, codeine, oxycodone, hydrocodone, and fentanyl
. It's important to take opioids only as directed, as they can lead to addiction