ditto what Kloudie states.
Follow the VMG function of your GPS. Some GPS dont have this function and you can then simply 'favor' the tack which shows the earliest ETA to your distant waypoint.
When following VMG (or earliest ETA) do some trials at slightly differing sailing angles as you watch the VMG while steering to get the 'best number'. Perfect sail trim and perfect sail shape will be needed for the 'best' VMG ..... but will probably vary during the long passage so you need to check the angles/trim/shape quite often. Also due to 'coriolis effect', the direction of the oncoming waves will be usually different (not equal) on opposite tacks .... so you need to carefully and often 'test' VMG on both tacks to insure that you are mostly keeping on the favored tack. Ditto with waves and swells generated by distant weather systems.
There are packaged instrument systems that can offer automatic VMG, etc. and calculate/plot WHEN to tack for best overall/optimum courses. Most of the top racing boats use such to optimize their 'performance'; yet. long distance cruisers can take advantage of such systems to minimize the total distance travelled. If you save 5%-10% of time during a 10-12 hour day .... thats ~1/2-1 full hour travel time saved (and NOT changing the boat speed!!!!).
Since the wind is never constant in speed nor direction, tactically you need to tack when the apparent wind direction goes forward ... and then you need to tack of the 'windshifts shifts' - good elemental sailboat racing texts describe the technique in detail. Generally - Just follow maximum VMG (or earliest ETA) on the GPS and tack if you must to keep the VMG at the highest possible value.
Scalloping (two variations)
1. Scalloping for waves .... to lessen the boats bow from plunging deeply into the face of oncoming waves (thus tending to stop the boat).
Dont let the boat 'leap' off the top of a wave crest, but rather bear off and steer at a greater angle down the backside of the wave at an angle so you sail through the trough at a greater angle (instead of allowing the bow to 'bury' into the face of the next oncoming wave); then, as the boat begins its climb/rise up the face of the next oncoming wave head up a little, so as to 'set' the boat for the next bear off down the back side of the next wave. This is a good technique for moderate to big waves that would otherwise keep stopping the boat. Summary: the boat will be a greater angle to the waves at the top of the waves and down deep in the trough .... the distance traveled looks like an "S"
2. Light wind/ small (or no) wave scalloping. Done in relatively 'flat water'.
(usually needs a small row of 'steering telltales' - a 'row' of small telltales attached to the sail at approx. your 'head height' running from the very front (luff) of the sail thence aft for about 8 feet, usually about 6-8 very small tales all in a 'row'
Once the sails are shaped and trimmed to perfection, the helmsman uses the 'steering row' as the ONLY reference to steer the boat. The helm is constantly but very lightly (fingertips on the helm) allowed to begin to head-up slightly until the first one or two of the steering row becomes 'agitated' on the leeward side. Such agitation will indicate the beginning of a 'separation stall'. Once the steering row 'begins' to become 'agitated' the helmsman gently bears off slightly until the steering row on the leeward side become 'quiet'. This will assure that 'aerodynamics' of the present sail trim/shape are working to the optimum. In following the 'steering row of tales' in this manner the boat will follow a gentle "S" course.
On most fin keeled boat you want your sail trim/shape so that the boat will have approximately 3 degrees of rudder angle to hold a beat - very 'light' weather helm pressure. Once you have set/trimmed to perfection and on a hard beat, increase your main halyard and/or cunningham tension until the 'helm' goes totally 'neutral' (no weather helm, no lee helm) ... then ease off until you have a 'very light or VERY little pressure' weather helm.
This is probably the fastest and most precise way to sail a boat on a beat .... but the sail trim and sail shape should be perfect. Such scalloping will usually result in the (fin) keel to begin to 'lift' towards windward by a few degrees .... which begins to counteract the normal 'slip to leeward' of the hull .... the boat is now pointing like a banshee and is 'fast'. This is a very effective steering method for FAST sailing in light to moderate winds (& minimal waves).
The above reply may be more complicated than what you need or desire; so, just extract what you need and what seems reasonable to you.
hope this helps