Worth saying, always stay on the ocean side of a boat, if you are hanging on, or when you initially get separated.
4-5’ waves really isn’t life threatening, especially if you have on your PFD, and you don’t panicked. Just relax, take your time and swim slowly in while keeping an eye out for the next wave coming behind you. Use those waves to help body surf you in. If the waves are dumping (with a really hollowed face), don’t try to swim or body surf when the wave is ready to break on you. Just take a breath, relax, and let the break take you. You may want to curl a bit into a ball and cover your head with you hands if you don’t have a helmet on. A dumping break can toss you around and drive you towards the bottom (and why you need to protect your head. PFD provides cushioning for you torso.) Once the energy passes and/or dissipates, you’ll pop back up. If you are relax, you’ll likely never get to the point of feeling that you have burned up the oxygen in your lungs (That sense of running out of air happens much quicker in cold water and why one really has learn to stay relaxed). The good thing is that if the waves are breaking on you, then the energy is taking you in. If you notice you in area where the waves are not breaking but are on either side of you, then you are likely in a rip. Swim yourself to where the waves are breaking so you can make progress towards shore.
In terms of trying to land in a surf zone where you have doubt about your ability to do so safely, the simple answer is DON’T. Find a safer and more protected spot. On most coastlines, there is going to be a nook or cranny when the wave action is less intense.