Yeah I remember when "it" happend to me, I panicked and it made things worse. I believe it is all mental, once you conquer the mental part, the physical part will be "healed".
If you do have these problems...
Performance anxiety
Masturbating too much
Watching too much porn
RELAX, all I can say. Course I've been on my own journey and still am, so I am very secure with my self and performance in bed. Just relax, by all means find something safe to calm the nerves, talk to the girl, talk to yourself, or just really chill.
Try and masturbate less and less to the point you can control yourself. Build a relationship with your demons; you'll become way way stronger.
If you do masturbate, use some lubricant and masturbate the correct way. In essence, you want to climax the way a ***** would do for you--more about massaging the head and surface of your ****, not the internal parts(only the hand can do that).
For me, it was also PORN. Porn is awesome, really gets one turned on easily. Porn is also a double edged-sword, it messed me up in the head when it came to sex. There wasn't any "magic". Real life sex is not like what you see in porn, maybe just a tad like 70's porn lol. Then again, I haven't hooked up with a kinky and open girl(I'm trying really hard to though). That's what I want, and I'm trying to hit it.