RxBlogger & Tantric Massage London both have excellent ideas. Zeus131 is actually posing two questions, erectile dysfunction (ED) and premature ejaculation.
Regarding ED, it can be thought of as psychological or physiological. Stress can cause this, whether relationship (family or partner), emotional or financial, etc. It can be difficult to have an erection in the presence of someone with whom you are not happy. Likewise if you're distracted by money matters, especially given the current global economy. This is when RxBlogger's psychotherapy & cognitive behavioral therapy can make a difference.
Physiologically, think of whether this is a new problem or gradually worsening. In other words, did it start just after you started a new medication? Blood pressure lowering drugs are well know for causing ED. Of course, if ED has been gradual in onset, we also worry about blood flow in general (since erections are basically a plumbing issue).
In fact, ED has been linked to heart disease later on. Therefore, if you're of the appropriate age, say 30-50s, check your cholesterol since too much can clog up your penile arteries even while laying down plaque in your heart. If you're older, and especially if you notice a little, ahem, shrinkage, check your testosterone (T) level. Not enough T can make it difficult for Viagra, Cialis & Levitra to work (just in case you're not getting the responce you expected).
Now let's move to premature ejaculation. There's primary & secondary. Primary is when you've always ejaculated earlier than you expected/wanted. Secondary is when this is a new problem, given that it wasn't an issue previously. Psychotherapy & cognitive behavioral therapy is key. There are lots of non-pharmacologic options as noted by both RxBlogger & Tantric Massage London. The key is to having a willing, patient & understanding partner.
If this doesn't work, you can talk w/your family physician about using SSRIs in an off-label fashion. In other words, SSRIs are typically used for depression & anxiety but are also known to cause anorgasmia (inability to have an orgasm) in some patients. This can be problematic if you weren't having any ejaculatory issues previously. However, if you suffer from premature ejaculation, then perhaps the other side effects of SSRIs might be outweighed by the possible anorgasmia.