Bad cramps who can relate?

I recently lost my virginity two months ago and I’ve had my period twice I’ve had really bad cramps and pain. Is that cause of sex? If so do you guys recommend something that helps it go away a bit