Pain during sex

I’ve been with my boyfriend for about 3 years but it’s been a long distance relationship. We don’t have sex regularly because we’re far away from each other but when we do, it hurts so much every single time. I thought the pain was going to go away but it hasn’t. My period used to be regular and now they’re very irregular. Is something wrong with me?? Please help