Boats can sail in any direction EXCEPT INTO THE WIND. So if that’s the way you want to go you have to zigzag from side to side of the no go zone. This is called beating to windward and involves tacking the boat through about 90 degrees from close hauled to close hauled through the no go zone.
Every time you change direction, even a little bit, you have to adjust the set of the sails. This is done either by ‘sheeting in’ when turning closer to the wind or ‘easing the sheets’ when turning away from the wind.