The drug , commonly known as Viagra, is a doctor-approved treatment mainly used to manage erectile dysfunction in men . Developed initially for cardiovascular problems , its unexpected side effects relating to blood vessel relaxation led to its repurposing as an powerful solution for sexual dysfunction . It works by boosting blood flow to the male