Consider the scenario of a boat trying to sail directly north, with the wind coming also directly from the north. Because the boat cannot sail directly into the wind, the sailor must alternate between northeast and northwest headings, which are commonly called "tacks." On a northeast tack, the sailor will generally point the sailboat as far north as it can go while still keeping the winds blowing through the sails in a manner that provides aerodynamic lift that propels the boat quickly through the water, then they will fall off to a certain degree to create more forward wind pressure on the sails and better balance of the boat, which allows it to move with greater speed through the water, but with a less advantageous angle toward the mark.
A good sailor can intuitively strike the balance between speed and advantageous angle within a certain range of degrees, because the boat will either obviously slow down too much or get too far off course. To find the optimum angle with more precision, though, the sailor will want to determine the velocity made good, which usually requires computation and instrumentation.
Suppose you are on a setting of 60 degrees NE, and the speed of the boat is 5 knots. By falling off to 65 degrees NE, you can speed up the boat to 5.2 knots. Is the extra speed worth the less direct progress toward the mark?
The answer requires basic trigonometry. In both cases you want to know the northward component of the velocity vector, which requires taking the cosine of the angle between north and the sailboat's heading.
cos(60) * 5 = 2.50 knots made north (vmg)
cos(65) * 5.2 = 2.20 knots made north (vmg)
In this case, the more upwind setting clearly makes more velocity made good toward the mark, despite the lesser speed.
There are several strategies for computing vmg in these cases.