I recently had to take a couple of months off surfing, and getting back in the water was... well, let's just say "embarassing"
Fortunately I thought it might be (self-fulfilling prophecy? ) so I surfed at a quiet moment on a small day to make sure I had some space and the waves weren't too challenging. But I was still a muppet
Next session and all was fine
My fitness was still way below par, but the natural flow was back in play and I felt I could surf again.
Keeping fit between sessions will help, obviously, as will something like skateboarding or an indoboard. A bigger, thicker board might be necessary too if you're only in the water every few months.