Been there big time! This will be long, but want to let you know how it all worked out for me.
Started with my first gf in high school. Took months to get over, but once I got over it, man, I was over it! Did not run into that problem again for years. But did run into it again:
Had not been with a woman for years. Bitter, bitter divorce, with a bitter horrible woman who did her damndest to destroy me. Finally decided it was time to get back in the saddle, and saw my first provider.
Things were fine. Not getting it up was the furthest thing from my mind. Was nervous as HELL, but started off with a bjtc with no problem (hadn't planned that, but it was so glorious, I couldn't stop her). Then thought I'd go for another pop. Got the cover on, got in, and within a few thrusts I was out and limp as a noodle. I was shocked. Not getting or keeping it up was the furthest thing from my mind. Rushed it I'm sure is all it was, and I just wasn't ready, but the mental impact was horrendous. Old thoughts came back in.
Our 2nd visit, same thing. I had it on the brain, and could not get one up for intercourse to save my life (a leisure sit back and receive a bj was not a big problem though).
After this visit, the thoughts were all consuming. All I could think about was failing to get it up. Even got so bad I could not get it up by myself anymore.
Took a big chance, was desperate, and went to a hypnotherapist a few days before my next visit with the provider. Yup, probably "junk medicine" or whatever you want to call it, but I went in with an open mind. What an experience that was! I left so relaxed I felt almost drunk. She gave me a CD to listen to as well, listened to it every night as I went to bed, and planned for the hour or two before the lady got to the room to lay back and listen to the cd and just mellow out, getting as relaxed as possible and listening to the tips on the cd. Important thing though was she (the therapist) gave me the "tools" to help put my problems out of my mind long enough to let the physical sensations overtake my anxiety.
So, she arrived for our 3rd visit. As we were having drinks, I was up front with her, and told her I was having a problem, and it was a mental block, talked about it for a bit, and asked for help to get me past it. Just getting that out in the open helped a great deal I think, and she was quite understanding.
I learned through the hypnotherapy to put it out of my mind to a great extent by focusing on her. Her skin, her nipples, how she felt, the way she smelled. Really focus intently on her. Smoothness and texture of skin. Smells of hair, skin, her expressions, eyes, etc. Visuals of her body and face.
So, it came time to give it another shot. Got the cover on quick (had it out, open and ready). I'm a bit large, so I was trying to be considerate and ease it in, and she grabbed my ass and pulled me in with a "get in there" type of thing (thought that was funny and cute as hell, and was just what I needed at the moment). Once I made it past the first 10 to 15 seconds or so and it was apparent it was not going to be a problem THIS TIME, I moved forward and again, never looked back.
It's mental dude. You gotta get past the mental part. Be up front and open about it (that takes a good part of the pressure off), and then relax, focus on her, and go with the mind set that if it doesn't work "this time", you're going to have fun regardless.
Viagra may help just a bit. It will NOT "cure" this problem, but can help a bit in keeping you harder, for just a little longer, and buy you a little time to get into the intercourse and let your body and sensations take over. (word of caution though if you do this, take only 1/4 tablet. Any more, and it is greatly desensatizing, at least for me, and counter productive. And see a doc. Don't go trying to buy the stuff over the internet). Do not expect it to "cure" this problem though, because viagra alone will not do it. You could take a bottle of the things, and if your brain isn't in the right place, it won't do you much good. In my experience, it will buy you a little time, but that's it.
Good luck. Many of us have been there. You can get past it, but you gotta focus on her and the sex, and not the problem.