You need to train and practice how to hold on.
There is a muscle men use to hold the pee when they want to reach the bathroom and not pee on the way.
It is the same muscle that can hold the sperm from bursting before you want to.
Practice squeezing and flexing this muscle 50 times, X3 per day,
and when you are having sex, and feel that you are about to cum, use the muscle to prevent it from happening, just like you would if you had to pee.
The other methods people mentioned here will work too.
But they require preparations.