Trimethoprim and sulfamethoxazole are antibiotics that are often combined to form a medication known as trimethoprim sulfamethoxazole (TMP-SMX). This combination works by inhibiting two different bacterial enzymes, thus preventing bacteria from synthesizing essential folic acid needed for their growth and reproduction.