Sex hurts

So me and my boyfriend were having sex and it started to hurt . what should I do