If it’s happening despite having sufficient foreplay (like 20-30+ minutes focused on you), not experiencing discomfort or pain, you were lubricated and relaxed etc then that’s something to go to the doctor about. Otherwise, more foreplay, lube if necessary, stopping immediately if you’re in any pain or discomfort.