Tonsillectomy is one of the most commonly done surgical procedures in children. There are many unreported deaths following tonsillectomy in children due to opioids. Genetic variations in liver microenzyme, CYP2D6, had been associated with some of the deaths. Opioids metabolized by CYP2D6 include codeine, tramadol, hydrocodone, and oxycodone. Ultrarapid metabolizers and some extensive metabolizers of CYP2D6 relatively produce more active opioid metabolites resulting in life-threatening adverse effects, especially in young children. Young and obese children with history of sleep apnea are at higher risk of developing serious opioid-related respiratory depression. The adverse outcomes can be avoided and the safety of pain management can be improved by CYP2D6 genetic testing before prescribing these opioids or by using alternative analgesics.