To get the best wave of the set you usually want to sail out quite far.
When you’re out the back and can see the set coming, it’s time to choose which wave of the set you want (if you’re lucky and it’s not busy). If it’s a 3 wave set generally I let the first wave go through and let it smooth out the riding area. For me, choosing between the 2nd and 3rd wave I don’t really mind.
Sometimes the last wave of the set will be the biggest and that’ll be the wave you want, if it’s not just going to close-out.
However, if you’re sailing a reef break and a certain size or direction of swell is ideal for that wave to work the best, then that would be the wave you choose. Knowing what swell direction and size is best for a wave normally takes a lot of observation and experience though.