Bactrim is made up of two drugs: sulfamethoxazole and trimethoprim. It belongs to the class of medications known as sulfonamide antibiotics. Bactrim stops the growth of certain types of bacteria that cause infections. It blocks two steps in the production of proteins and nucleic acids that bacteria need to survive.