Finasteride is a medication primarily used to treat benign prostatic hyperplasia (BPH) and male pattern baldness. It works by inhibiting the enzyme 5-alpha-reductase, which converts testosterone into dihydrotestosterone (DHT). Elevated levels of DHT are linked to both BPH and hair loss.