Co-trimoxazole is used to treat certain bacterial infections, such as pneumonia caused by pneumocystis jirovecii (an infection of the lung caused by a fungus that most commonly occurs in patients with altered immune system), bronchitis (infection of the tubes leading to the lungs), and infections of the urinary tract.