I have a girlfriend and we just tried to have sex for the first time, but I could not get hard enough to actually have sex. I was very nervous and she didn't seem so at all, but I don't know if that's it or if something else is wrong. I don't think anything is wrong though, because I can get fully erect while masturbating and just at random times during the day (I'm just a teenager). What can I do?
Trouble getting an erection
Welcome to A2A, hamhamham. As Radeckl said, nothing is wrong. You were just (understandably) nervous. With time and experience you'll get less nervous and the problem will go away.
There's nothing wrong it's just nerves, as the others have said.
Take it a little slower, more foreplay, get used to and more comfortable with each other. Explore each others body's, get good and turned on and then proceed to intercourse, or fucking what ever you want to call it.
There is no punishment. There is no reward. There are only consequences.