@aperson015,
How supportive is your partner? If you feel pressure to "perform", it makes things much worse. Is this pressure coming from your partner, or from yourself?
1) If you have a supportive partner, then talk to her to take the stress off. You should learn to give good oral sex... in a good, giving relationship there are lots of things to do other than vaginal intercourse. Talk about it. Work through it. Enjoy your relationship without worrying about it and it will happen.
I tend to have problems when I feel insecure with a partner. With a supportive partner, things just work better (including erections).
I am a middle aged man now, sometimes it just gets hard on its own, sometimes it needs a little coaxing or a lot, and yes, sometimes it just refuses to get hard. With a good partner, you learn what she likes, you can communicate what you like, and you don't need to worry.
2) You should talk to a doctor. It is possible that there is some physical issue. You should
definitely talk to a doctor before you use viagra (as others have noted). There is a reason that this is a prescription medication.
3) You may consider therapy. Talking to someone about your feelings, who won't judge you, is a good thing. There are psychological techniques that have been shown to help with a lot of men that a therapist can help you with.