Viagra, also known by its generic name Sildenafil, is a medication used to treat erectile dysfunction (ED) in men. It works by increasing blood flow to the penis when a man is sexually aroused, helping him achieve and maintain an erection.