Sometimes you need to access the underside of your boat. Perhaps to free a stuck centerboard, or to remove one for repairs. Or to inspect for and fix some damage.
There are many techniques for how to achieve that, but let's focus on careening your boat, as this is the one technique that you'll need if you find yourself in an emergency situation.
This works in shallow water or if the boat is beached. With the boat afloat at a dock you can use the same technique if you need to get at something higher up on the mast. You can also do it in your yard, by launching the boat from the trailer onto the lawn or a bit of old carpet (to prevent scratches).
The mast needs to be up and the rig tensioned, but if you aren't sailing, you wouldn't rig the boom. If you are out on the water, you'd secure the boom with topping lift and mainsheet.
When you have the boat beached or on the ground, you take the jib halyard or spinnaker halyard and pull sideways. If in shallow water or at the dock, you may need a helper to hold the boat so it doesn't just follow your pull. Once you get the hull to rotate, it will get progressively easier to counteract the righting moment. With the boat horizontal, you can tie the halyard off to a concrete brick or a bucket filled with sand and it will hold the mast down.
Note that the diagram shows the jib halyard and not the main halyard. The reason is that the main halyard exits at the top of the mast, which is unsupported. This is of particular concern when you have removed or no longer have the jumper stays. (They aren't needed otherwise, so it's fine to remove them, just be aware that you then can't use the tip of the mast to careen your boat).
The jib and spinnaker halyard sheaves are near the point where the shrouds meet to stabilize the mast. If you pull at that point, the loads get taken up by the shroud and you don't end up bending or breaking your mast. That's the reason you want to make sure your mast is properly supported and the rig tensioned before you careen your boat.
The whole process takes only a few minutes and is great for freeing a stuck centerboard or to make a quick repair to a broken uphaul or downhaul. With the boat on its side, you have convenient access to both the opening of the centerboard trunk, as well as the centerboard controls on the inside.
At the dockside, you should be able to get the boat to float on its side in order to reach a wind indicator or fix something that has gone wrong with a halyard. You probably need to empty the boat and later bail it, while freeing a CB for a beached boat can be done even with a boat that's loaded. (You may need a helper as it will initially quite strongly resist tipping).