Opioids are a class of drugs that include the illegal drug heroin, synthetic opioids such as fentanyl, and pain relievers…