Opioids are a class of drugs that include both prescription pain relievers, like oxycodone and morphine, and illegal drugs, such as heroin. These substances act on the nervous system to relieve pain, but they also carry a high potential for misuse and dependence due to their euphoric effects.