If sex hasn't hurt in the past, there are only a few reasons why would be now with the same person.
You could have an infection. Which you'd need to go to a doctor to get antibiotics. [& there are cases of having one without other symptoms, but other symptoms include stinging, itching, burning, oder or discharge.] You can also have pain during sex due to a yeast infection. Which you could treat yourself.
Could you be having spasms of the muscles at the opening of the vagina, which causes pain when your partner enters. It is most commonly a response to fear of some kind, like getting pregnant or of sex in general.
A lack of lubrication causes pain. Which is the most common reason after pregnancy.
If the pain starts deep inside you, it could be a warning sign of an internal problem like Pelvic inflammatory disease, endometriosis, a mass, scar tissue or ovarian cysts.
Other than that...well, I'd say see a doctor. Buttt, they're just some suggestions of what it might be?