Viagra, or sildenafil, is a drug primarily used to treat erectile impairment , a ailment where men have trouble achieving or keeping an firm erection. Beyond the primary purpose, it has also found off-label in the treatment of pulmonary high blood pressure in the lungs and other medical issues .