Ethambutol is a medication primarily used to treat tuberculosis (TB) infections. It works by inhibiting the synthesis of the bacterial cell wall, which is essential for the survival and growth of Mycobacterium tuberculosis, the causative agent of TB.