1. Flexibility. The most overlooked aspect of exercise is flexibility. You should be engaging in a flexibility routine almost every day of the week. A good routine will include at least one stretch per muscle group. Apart from decreasing muscle soreness, stretching can also lower the risk of injury and give you a better workout.
2. Warm Up. Warming up, like stretching, loosens your muscles up and reduces the risk of injury. A good warm up will be a lighter intensity version of what you plan to exercise. If you're planning on bench pressing 135 pounds, warm up by only doing 45 or 95 pounds.
3. Cool Down. Cooling down properly can also help you avoid some soreness. Instead of stopping the treadmill or bike, decrease the intensity and slow down until you're at a walking pace. Hold this pace for about 5 minutes and then stop. At one point almost everyone believed that muscle soreness was caused by lactic acid buildup in the muscle. Cooling down was thought to help rid the muscle of lactic acid and prevent soreness. Its now thought that soreness is caused by small tears in the muscle so cooling down might not help as much as it was once thought to. Since it is safer to let your heart slow down gradually, cooling down is still a good idea.
4. Don't Exercise Too Much. If you're just starting out, don't exercise too hard too soon. If its your first time working out, exercise lightly to avoid getting sore. Since even light exercise can cause some soreness, imagine what a rigorous workout will do to a beginner.
5. Rest. If you do get sore, the only remedy is rest. You should rest at least 48 hours before exercising the same muscle so if you workout chest on Monday, avoid doing it again until at least Wednesday or even Thursday. Remember that a muscle grows when it gets repaired. If you're constantly breaking it down at the gym, you'll get weaker and smaller instead of bigger and stronger.