Sail Trim

Whether sailing up wind or down, the boat's performance depends on Sail trim. To achieve correct trim the Sail must be adjusted so it is neither over trimmed or under trimmed. Over trim and under trim are explained here So they can be avoided.

Over Trimmed

In the illustration the wind is coming directly across the beam. Here the Sails are in too tight resulting in a condition called overtrimmed. The wind is creating a pushing force against the sails but very little lift is created because the air can't flow smoothly across the sail's back side. As a result, the forces tend to heel the boat and push it sideways but do not provide much drive to propel the boat forward.

The sails should be eased out so that the air can travel across both sides of the sail smoothly. Then they will be able to generate lift and the boat will perform properly. The way to find the right trim is to ease the sails until they begin to luff. (The luff or forward part of the sail will start to puffin.) Then trim back in just enough to fill the sails and stop them from luffing.

Another way to correct for an over trimmed situation is to head up. When you get the boat pointed in the right direction, it will accelerate and heel over a bit more. This is due to the increased lift generated by the sails. Correct by heading up if you are beating. If you're reaching in the direction you want to go, ease the sails.
 

Under Trimmed

The sails are under trirnmed when they are eased out to far. The sail will luff (flutter) and the boat will slow down, standing up straighter in the water. Here the sails need to be trimmed in, to be filled, in order to get the boat moving. Luffing the sails can be done to slow the boat if desired, but should not be done too much or too long. Sails are damaged by extensive luffing.
Sailing Trim Guidelines.
Sailing Upwind: "When in doubt, ease it out."
Sailing Downwind: "Sails ninety degrees to the wind."