I have been avoiding sex because a few times during sex with my girlfriend I lost my erection for no apparent reason.. I may have just been out of it. We had a VERY healthy sex life before this issue which started 6 months or so ago. Basically she got really mad after one of the times it happened. I got nervous and we started having sex less and less because I was scared I would lose my erection or not be able to get an erection on the spot. I also sometimes get destracted by thoughts which interfere with my ability to just enjoy sex. This happened progressively over the last six months. I just want to be able to have a good healthy sexual life. I've tried to just let it go but my brain holds onto this anxiety that I might not perform right or thoughts that distract me from enjoying sex. I'm against drugs honestly but at this point I'll try whatever.. Viagra if if it will just make me concentrate on sex and enjoying it. Or a prescription to help me get over anxiety this all causes.

Please any advice helps out

Thank you