I had this problem when I first became sexually active and it continued for a long time. I think part of it is psychological but it hardly helps to "not think about it". The more you try the more not to the more you will.
The thing that helped me was to masturbate until I got close to cumming. Then I would stop masturbating until the sensation subsided. Eventually you can get closer and closer to the actual moment and still be able to stop. When you get to this point, practice keeping yourself close to the edge (in fact this practice is often called edging). With practice you'll be able to keep it up pretty much as long as you want. I would go for some specific time. At first 10 minutes and eventually 30. You can go longer but really it can get boring.
After you can do this you'll need to start trying to slow down as you feel yourself get close and practice masturbating slowly, with the idea to be able to see it coming and slow down and stop when necessary in time without it being "oh my god stop NOW!". Once you can do this you have the necessary mechanics in place to use your skills during real sex. You will need an understanding partner because at first all your practice will disappear when you try it on a real person. Don't get discouraged. After a few tries you'll be able to make the connection. Once you do it will take a while but eventually you'll be able to make love for pretty much as long as you want.
Two things to note. First, you will need to learn to make love so that you can change the pace when necessary. if you are feeling like you are getting close and a brief pause doesn't stop the feeling from coming back too quickly again and again then you will need to change position so that you can stimulate your partner with your hands while you pump slowly (too keep your erection) until you feel in control again or even all the way to the finish line.
Second, porn can be a real help in getting hard and enjoying the masturbation practice but make sure it doesn't cause you problems in your real sex life. Try masturbating with just your imagination (preferably about your partner) every 5th time or so.
Good luck.
The thing that helped me was to masturbate until I got close to cumming. Then I would stop masturbating until the sensation subsided. Eventually you can get closer and closer to the actual moment and still be able to stop. When you get to this point, practice keeping yourself close to the edge (in fact this practice is often called edging). With practice you'll be able to keep it up pretty much as long as you want. I would go for some specific time. At first 10 minutes and eventually 30. You can go longer but really it can get boring.
After you can do this you'll need to start trying to slow down as you feel yourself get close and practice masturbating slowly, with the idea to be able to see it coming and slow down and stop when necessary in time without it being "oh my god stop NOW!". Once you can do this you have the necessary mechanics in place to use your skills during real sex. You will need an understanding partner because at first all your practice will disappear when you try it on a real person. Don't get discouraged. After a few tries you'll be able to make the connection. Once you do it will take a while but eventually you'll be able to make love for pretty much as long as you want.
Two things to note. First, you will need to learn to make love so that you can change the pace when necessary. if you are feeling like you are getting close and a brief pause doesn't stop the feeling from coming back too quickly again and again then you will need to change position so that you can stimulate your partner with your hands while you pump slowly (too keep your erection) until you feel in control again or even all the way to the finish line.
Second, porn can be a real help in getting hard and enjoying the masturbation practice but make sure it doesn't cause you problems in your real sex life. Try masturbating with just your imagination (preferably about your partner) every 5th time or so.
Good luck.