Opioids are a type of pain medication made from the poppy plant. It is the same plant that is used to make opium and heroin. They are effective for treating acute or new pain after an injury or surgery.