My girlfriend is going to leave me because i have trouble getting hard for her

me and my girlfriends sex life hasn’t been the best for a while and now i’m having trouble even getting hard. she’s the most amazing person i’ve ever been with and it frustrates me so much that this is happening and i don’t know what to do. last night she brought up breaking up with me if it doesn’t get better and i just need some help

I can have that trouble if I’m not feeling close to her. Usually a result of something she has said or done in the moment that puts a barrier up.
Then if you worry about it and try to go hard, it won’t happen. Have you tried the blue pill? Is there something she does or can do that helps? Rather than her being critical, kindness and gentle loving from her might spur him into life.

Get on the V until you sort it out, takes the pressure off

My wife has been very supportive. She recently spent a couple of nights with an ex of hers. Lots of fun for us and pushed my ED to the back of my mind

Doesn’t sound like the most amazing person to me. A reason for her to leave would be if you had ED and not do anything about it while trying to avoid sex because of it. As long as you are doing your absolute best to improve your sex life and as long as the relationship is fine otherwise there is no good reason for her to leave.

You should be working on this together.
Try having sex as much as possible while working on your psychology and pelvic floor using the app and therapy. Viagra or Cialis are great tools to try but will not solve the issue by themselves. Try to have a backup plan where you can still satisfy her without getting hard.