A traditional Boom Vang is a block & tackle set at about 45 degrees between the mast and boom.
The vang helps keep the boom from lifting on a run causing the sail to loose shape. It can also perform other functions to assist sail trim. Google "Boom Vang" and you'll find lots has been posted on the subject.
Sunfish racing rules disallow the additional vang rigging so a partial vang is created by looping the tail of the halyard over the gooseneck and at least preventing the gooseneck from riding up the mast.
Some pictures of advanced Sunfish rigging techniques can be viewed here...
You mentioned in earlier posts that you are learning to sail a Sunfish. Therefore, I wouldn't worry much about a vang. Sunfishers did without it for decades. The main purpose of a vang on a Sunfish is to hold the boom down in windier conditions. For that reason, most racers tie a vang when setting up.
As you indicated, the tail end of the halyard is used to tie a vang over the gooseneck (thanks Wayne for the image).