Sore?

I haven't had sex in a while now, I have had sex many times but when I used a tampon just before it hurt.... Why is this? Because I haven't had sex in a while? ..... #confused