Depending on the boat you sail, the boom vang will be one of the most important controls to determine the twist of your mainsail.
As we go from sailing upwind to across the wind and then downwind, the difference in mainsheet tension will determine how much the boom will try to lift as you ease the sheet and this is where vang tension plays its part.
When sailing upwind, different amounts of twist in the mainsail are needed depending on wind strength and sea conditions and as a rule of thumb, in 10-12 knots of wind the main telltale should be breaking 50% of the time and not much or any vang will be needed.
In order to replicate settings for each wind strength and angle of sailing to the wind, it is important to have marks on the vang rope as a reference for the correct amount of tension to control the leech of the mainsail for the current conditions.
When you sail into a lull, the mainsail begins to stall and more twist is needed so the main sheet is eased until the tell tail eventually flies but with the vang on, the mainsail moves to leeward closing the slot. With the vang left slack, the boom is able to rise and the mainsail twists at the top without losing power from the lower sections of the mainsail, and without dropping the boom to leeward and closing the slot.
In light wind and choppy conditions have the vang on hand tight to stop the boom from bouncing but constantly check that your twist is correct by watching your tell tales.
As wind speed increases, the twist is controlled by a combination of sheet and vang tension.
In heavy air where your traveller is completely to leeward and you are still easing mainsheet to keep the boat upright, the mainsail will begin to flap when the mainsheet is eased. Pull your vang on to tighten the mainsail leech to stop it from flapping while keeping power in the leech. You are in effect driving off the leech of the mainsail.
In these conditions ensure your outhaul and Cunningham are pulled on hard and your backstay (if you have one) is at maximum to flatten the mainsail as much as possible without inverting it.
When reaching, the vang is the main control which effects mainsail twist. As your boom is eased beyond the quarter of the boat, the mainsheet is no longer effective at holding the boom down, so the vang takes over.
On a run, the boom is even further out and the mainsheet is now completely ineffective at controlling mainsail twist, pull your vang on to keep your top batten parallel to the boom and this keeps the mainsail fully projected to the wind.