Anal for the first time

So my boyfriend and I were having sex and both got into it more than usual as we hadn't been able to see each other for about a week due to our schedules. Anywho... As I said we were having sex when he puts his penis in there and at first it went in so effortlessly but when it slipped out and he tried to put his penis back in, it hurt. He tried adding lube but it hurt so much. It's definitely something we would like to try again. Any suggestions on what we could do to have it hurt less? How was your first time?