Generic Bactrim is the combination of Trimethoprim and Sulfamethoxazole that destroys the bacterial infections in your body. It blocks two consecutive steps in the biosynthesis of nucleic acids and proteins essential to bacteria. Sulfamethoxazole inhibits bacterial synthesis of Dihydrofolic acid that is necessary for the multiplication of bacteria. This way the spread of the bacteria is completely stopped. But, Sulfamethoxazole in not able to destroy the bacterial colonies. Thus, the need for the other element in the combination arises. Here Trimethoprim plays a role;it blocks the production of Tetrahydrofolic acid from dihydrofolic acid by inhibiting the required enzyme, Dihydrofolate reductase.
Thus, the production of proteins essential for the growth of bacteria is stopped. This way the bacteria get starved and ultimately they die due to this. Please note that generic BACTRIM treats only the bacterial infections. It will not show any effect on viral or fungal infections.