According to Physiology of Sports and Exercise:
Every endurance exercise session should conclude with a cool-down period. Cool-down is best accomplished by slowly reducing the intensity of the endurance activity during the last several minutes of your workout. After running, for example, a slow, restful walk for several minutes helps prevent blood from pooling in your extremities. Stopping abruptly after an endurance exercise bout causes blood to pool in your legs and can result in dizziness or fainting.
When you've been working out near the lactate threshold, your body has also been piling some amount of lactate. If you lower the intensity of your workout, such that you get enough oxygen, your muscles will start using lactate as a fuel and get rid of it. Because burning lactate creates by products like CO2, it's advisable to keep up some level of activity, so that your body can get rid of it easily.
I would therefore suggest to reduce the intensity of your workout. For example in running, start jogging at a speed your still able to talk. This ensures you get plenty of oxygen (to pay your oxygen debt), while still maintaining sufficient blood pressure to let your body adjust itself. In cycling you could keep up high revolutions, but with very low resistance or in swimming you could vary your strokes, focusing on getting back to normal breathing.
As md5sum suggested: a recommended cool down for weight lifting is a short cardio workout (stationary bike, treadmill, etc). Depending on the intensity, I'd recommend a bike over a treadmill as this is non-weight bearing, which can be pleasant after heavy squats/leg exercises.