Bactrim and Bactrim DS are antibiotics used to treat ear infections, urinary tract infections, bronchitis, traveler's diarrhea, shigellosis, and Pneumocystis jiroveci pneumonia. Bactrim and Bactrim DS contain a combination of two antibiotics, sulfamethoxazole and trimethoprim , that treat different types of infection caused by bacteria.