There's no doubt that you've been walking or running along, and all of a sudden you get a stabbing sensation in your side that makes you stop in your tracks. Anyone that exercises has experienced a side ache, and anyone that's had one wants to know how to avoid them.
When you exercise, blood flow is shunted from your abdomen, where most of it usually hangs out, and is redirected to your exercising muscles which are usually your arms and legs. This shunting is called vasoconstriction, and when it is done too abruptly, that lack of blood can cause pain in your abdomen. Warming up allows your blood to slowly redistribute to your exercising muscles to avoid such a fast and painful stitch in your side.
If vasoconstriction is the reason for a warm up, vasodilation is the reason for your cool down. Just as that blood moves into your limbs when you start exercising, when you stop, that blood rushes back into your abdomen, running you the risk of a blood pressure drop that can make you pass out.
Often when a side ache hits, you will see people put their hands on their heads. Now that you know the reason for a side ache, it makes sense that raising your arms would cause some of that blood to go flowing back to your organs to alleviate pain- but this isn't a cure all. If a side ache hits, just slow it down, but don't stop completely, until the pain subsides.
A proper warm up should last around 5-10 minutes and be a lower intensity version of whatever exercise you plan on doing full tilt. If you are going for a run, a light jog or brisk walk before you take off should be enough to keep you from doubling over in pain. Same goes for the cool down: Don't go from a run to a complete stop; always slow down and give your body a few minutes to acclimate.