Sails are limited in how close to the direction of the wind they can power a sailing craft. The area towards the wind defining those limits is called the “no-sail zone”. To travel towards a destination that is within the no-sail zone, a craft must perform a series of zig-zag maneuvers in that direction, maintaining a course to the right or the left that allows the sail(s) to generate power. Each such course is a “tack”. The act of transitioning from one tack to the other is called “tacking” or “coming about”. Sailing on a series of courses that are close to the craft’s windward limitation (close-hauled) is called “beating to windward”.
You don’t sail directly upwind; sailboats can’t do that. You sail at an angle to the wind.
EDIT:
https://en.wikipedia.org/wiki/Tacking_(sailing)