Sail a heading that is close to upwind in the direction of your destination with good speed, a close reach. Close-hauled will be the main and foresail pulled tight along the boat centerline and will allow the boat to sail closest to directly upwind, but speed will be smaller.
On most sailboats this will be about 45 degrees from the wind direction. When you’ve gone as far as you can on this tack, turn the boat through the wind (or changing direction by tacking), releasing the jib sheet out of its cleat or off the winch drum as the front of the boat (bow) turns through the wind.
The main and boom will come across the boat. The mainsail will self-set on the other side, but you will have to quickly pull in the jib sheet on the now downwind side to its cleat or winch, while steering the boat so the mainsail fills and begins to draw again.
If you do this correctly, the boat won’t slow down much and you will be sailing to windward in the other direction. If you’re too slow tightening the jibsheet again and the boat bears off the wind too much, don’t panic.
The boat will be pushed sideways a little until it gains speed. Another scenario would be to fail to put the bow of your boat through the wind quickly enough and the boat comes to a complete stop.
This is known as being in irons, which is embarrassing, but every sailor has experienced it, whether or not they’ll admit it is another story. Being in irons is easily remedied: when the boat is blown backwards you will be able to steer, and as the bow is pushed off the wind you will achieve an appropriate angle to the wind to sail.
Point the tiller in the direction you wish to go and tighten the jib sheet to windward, (backwinding the sail). The wind will push the bow through the wind.
Once you’ve completed your tack, release the sheet from the winch on the windward side and pull in the sheet to leeward and you’ll be on your way again. Because speed is so easily lost when tacking, you’ll want to perform this maneuver as smoothly and quickly as possible. Keep tacking back and forth until you get to your destination.