Sildenafil and Viagra are popular prescription medications for erectile dysfunction. These medications take effect about 30 to 60 minutes after being taken. Sildenafil can be taken with or without food, but you should avoid eating large meals before taking these drugs. Tadalafil is another common ED medication. It works best when taken on an empty stomach before sexual intercourse.