Modern sailboats can sail up to about a 45-degree angle from the wind. For example, if the wind is blowing from the north, a boat can sail from about northeast on port tack (“tack” also describes which side of the boat the wind is blowing from: “port tack” means the wind is coming over the port, or left, side) all the way through east, south and west to northwest on the starboard tack (wind coming over the right side of the boat).
On the new tack, you’ll find you’re sailing in a direction that’s at about right angles to the old tack, with the wind still at about 45 degrees, but now on the other side. Tack again and again and the zig-zagging will move the boat upwind, even though the boat can’t sail directly into the wind. Sailors call this “beating,” or “tacking,” to windward, and doing it efficiently takes more skill and practice than anything else in sailing. But learn to do it well and you can sail anywhere.