Inconsistent consistency

I am a 25 yr old active male who has had a girlfriend for 2 years. The past 7 months I had really struggled with erections and making sure I can have sex. When I do manage it I notice that my confidence is high and the next few days I can do it. If however I don’t see her for a week or 2 I struggle to get it up as I can sense there is pressure on performing. I am now really thinking about the possibilities of medication but I don’t want to become reliant on it which I feel like could happen. My girlfriend is amazing and is supportive but I know subconsciously it frustrates her and it is so demoralising and borderline depressing. I notice an instant mood switch.

There’s time with the playful action before I’m hard but when it acc gets to the deed it’s like I freeze and just loose my erection and can’t get it back.

Any help, advice or general feedback would be much appreciated.

Cheers