Bactrim fight bacteria in your body. ?? Bactrim is used to treat infections such as urinary tract infections, bronchitis, ear infections (otitis), traveler's diarrhea, and Pneumocystis carinii pneumonia. ?? Bactrim may also be used for purposes other than those listed in this medication guide.