Appropriate capsize recovery techniques vary by wind speed, and there are several methods available for righting the boat  in situations where the wind is high and you are unable to keep the boat from re-capsizing. However if you can recover without setting the anchor or having a crew member swim around to the bow to line the boat up into the wind, the recovery will be quicker and easier.

To recover on the first attempt (without re-capsizing) with the least effort in the broadest range of conditions, here are two very useful tips.

First, uncleat the gnav/vang (in addition to the mainsheet & jib), as this will reduce the effect of the wind on the sail when the boat comes back up.

Second, while up on the gunwhale, before stepping onto the centerboard, consider what effect the wind direction will have on the boat once it comes up, and plan the effect the arrangement of your and your crew's weight will have on the boat's balance at that point.

Under almost all capsize conditions where you're not right by a lee shore or dock, the person on the gunwhale can take as long as they want to consider the situation and to discuss it with the rest of the crew.