How do I make sex not hurt?

Today me and my boyfriend tried to have sex for the first time and it hurt soooooooo bad😫 it was like there was a wall blocking his dick. I couldn’t even stick it in. My hymen is broken but it still hurt. Are there ways to prevent this pain??? Please lmk💕