Cough syrup containing dextromethorphan and codeine is a common medication used to treat sore throats. It combines the effects of two active ingredients: codeine, a pain reliever. Dextromethorphan works by affecting the part of the brain that controls coughing. Codeine, on the other hand, is an opioid that acts as both a pain reliever and a cough s