Rifampin is an antibiotic primarily used to treat tuberculosis (TB) and other bacterial infections. It belongs to the rifamycin class of antibiotics and works by inhibiting bacterial RNA synthesis, which prevents the bacteria from replicating and spreading.