Finasteride is a medication that is commonly used to treat male pattern baldness. It works by blocking the activity of an enzyme called 5-alpha reductase, which converts testosterone into dihydrotestosterone (DHT).
DHT is a hormone that is linked to hair loss, so by blocking its production, finasteride can help to slow down or stop hair loss.