ACE inhibitors are a class of medication used primarily to treat hypertension and heart failure by relaxing blood vessels and reducing blood pressure. They work by inhibiting the angiotensin-converting enzyme, which decreases the production of angiotensin II, a substance that narrows blood vessels.