Don't start fresh - Warming up your muscles and your body is a very important step to avoid cramps. If you start your workouts by going hard without a warmup, you'll shock your muscles. Take it easy for about five minutes, slow jogging, jumping jacks, small easy aerobics.
Keep hydrated - Also a great idea if you're doing any kind of exercising...water is essential to carry nutrients throughout your cells. It seems only right that it will maximize the functions of your muscles and help avoid cramps.
Keep full of electrolytes - Not enough electrolytes can lead to muscle cramps. This combined with the step above will make sure your body has everything it needs to function properly. In longer workouts (25min+) drink a low-cal or zero-cal sports drink mixed with or alongside water.
Stretch & Cooldown - By slowly relaxing your muscles, you will reduce the chance of once again shocking those muscles. Take your time to slow down your heart rate, decrease your big motions, and hold stretches. Never pulse a stretch, and always hold for at least 15 full seconds.