Sildenafil is used to treat erectile dysfunction, a condition where you are unable to get or keep an erection firm enough to have sexual intercourse. It works by relaxing the blood vessels in your penis, allowing blood to flow into your penis when you get sexually excited. This medicine will only help you to get an erection if you are sexually stimulated. Therefore it is taken on an as-needed basis.