Both work here, and they buy different things.
From the beach costs nothing beyond a mask, and it is the right answer for a family staying on Okaloosa Island. You go when the water looks right rather than when a boat is scheduled, you can abandon the plan in five minutes if it is murky, and the walkovers at the main accesses have parking and restrooms. The limits are distance and confidence: the modules are a real swim out, and there is nobody watching you.
From a boat buys structure you cannot reach. Operators run to nearshore reefs, wreck sites and the pass, supply mask, fins and flotation, and put a crew member in the water with nervous swimmers. For anyone who has not snorkelled before, that last point is worth the fare on its own. Trips commonly run two to three hours and sit in the $50 to $90 band per adult, though rates move with the season.
A third option deserves a mention because this coast does it well: paddle out. A kayak or paddleboard from the beach lets you park over a reef, tie off to nothing, slip in and have a floating base to climb back onto. Do it on a calm morning only, and only with something tethering the board to you.
Whichever you choose, take reef-safe sun cream and a long-sleeved rash vest instead of covering your back in lotion. You are face-down under a Florida sun for an hour.