You seem to be suffering from performance Anxiety. Due to overthinking about your ability to satisfy your partner, your performance goes down, because sex is a mind game, needs to be done under relaxed state, not under any pressure or tension.
Next Steps
Whenever you go for sex, tell ur partner before it that we r going to enjoy foreplay only, so pressure of good performance will be lifted away from yr shoulder. So u can continue foreplay for 20-30 mins, once u start having enough self confidence, then suddenly insert it inside, once it's inside it won't get loose.
Health Tips
You can do early morning jogging for 15 mins daily
Along with you can do meditation/yoga/pranayam,whichever suits you
You can avoid junk food and take healthy diet
Apart from that you can do deep breathing,when you have overthinking
Inspirate for 1st 3sec slowly and expirate for 2sec slowly
You can also do reverse counting like 100,99,98,97... And so on
It will make you calm and relax