90%+ of erection problems for men under 40 are psychological. Yes, being healthy, working out (especially cardio), no smoking, diet, and moderate drinking all help, but far and away the number one issue is performance anxiety.
It does help if you're into the girl, but if you've been out drinking and it's a ONS or girl you just met or stared dating, PA is fairly common. Nowadays, there's no reason not to have some Viagra/Sildenafil (generic) on hand. I pop 10mg every time a bang a casual chick which is 100% these days. It's all I need. Any more and I get side effects and it affects my ears (have tinnitus). 10mg works like a charm for a few hours.
Chicks watch porn these days too so, like it or not, they do expect you to perform. Just the way it is. If you can't get a hard d*ick, she'll find someone who can, especially if she’s hot.