Why is sex painful?

I’ve had sex with two different guys and with both of them it was very painful. Is there something wrong with me?