Opioids like codeine, oxycodone, and morphine are potent pain relievers that are prescribed for severe pain conditions such as post-surgical pain or severe endometriosis. Due to their high potential for addiction and other serious side effects, opioids are usually prescribed only when other pain relievers are ineffective. They work by binding to opioid receptors in the brain and spinal cord, blocking pain signals.