Bactrim is a combination antibiotic containing two active ingredients: sulfamethoxazole and trimethoprim. It is used to treat a variety of bacterial infections. In pediatrics, Bactrim is commonly prescribed to treat urinary tract infections (UTIs), otitis media (middle ear infections), and certain types of pneumonia.