The general expectation is that a man can get a hard-on at the drop of a bra strap and keep it until his partner's ready to take it.
Unfortunately, for many reason, some of which are outlined above, it it doesn't always go like that. And as is also pointed out, it can spiral into a blame game and a turn-off for both of you.
You do both need to be focused on each other, but the crucial thing, in my view, is to take it as it comes and be inventive wihtout being judgmental. I find it a big turn-off if Mrs P. is all over me when I would prefer a more subtle approach, and I do suffer from 'the expectation', especially as I'm now pushing 60 and have been fairly ill on and off for the last few years.
As it happens, all men find it harder to get it up and keep it up as they age; add illness, stress and obesity on top and you can be struggling in your 30s! If this is beginning to happen to you, it's a good idea to review how you 'do sex'; it will probably work better if the woman gives your penis as much attention as you are gioving her - if it won;t get or stasy hard, you just need to do more work on it!
Plus, you need a plan B for when it just won't come out to play. Whether that's cuddles, manual stimulation of each other, sex toys, or even just both of you wanking in front of each other doesn't matter much. The important thing is that you can be intimate without the spectre of the floppy elephant in the room.
Me, I'm perfectly happy to use a dildo or strap-on on Mrs. P. if I can't persuade Percy to perform, though some men would find that demeaning. I just think it's a great way of giving her a good rodding on the days she feels the need for that sort fo sex. Other days we might just cuddle, or do some oral or whatever. Another of my favourites is to do a 69 with Mrs. P on top, giving me oral access to her bits and the opportunity to get a dildo in should the need arise.
Don't get misled by porn into thinking sex always goes on for hours and erections take care of themselves. They might, but they don't always. And ladies, it's almost never the case that he's gone off you; just remember that it's a bit like having trifle for breakfast - it can be done but it's easy to see why not everybody is up for it at a given moment.
And while we're at it, sometimes a small lifestyle change can pay handsome dividends in the readiness stakes - a bit more exercise; one less drink; you know the things you should be doing!