Tadalafil works by inhibiting the action of PDE5, an enzyme that regulates blood flow. By doing so, it helps to relax the smooth muscles in the blood vessels, particularly those in the penis, leading to increased blood flow and improved erectile function.