Make sure that you begin any workout with a good warm up consisting of cardio (i.e. jumping jacks, windmills, etc.) and dynamic stretching. Cardio and dynamic stretching at the beginning of a workout helps to get the blood flowing, loosen joints and gets your muscles warm, which can help you prevent injuries during your workout.
When stretching, try not to bounce. Instead, remain motionless while stretching the muscle to minimize stress on your joints, which can cause injury. Always breathe into your stretch - if you're not breathing, you're not stretching.
Do not stretch a muscle until the point of pain, but to the point you feel a good stretch occurring. Gentle stretching will warm your muscles and help you avoid injury during your workout.
It is important to make sure you cool down your muscles in a safe way after a workout. Again, the focus here is to stretch by using what is known as static stretching. Here you stretch to your farthest point and hold the stretch.
Concentrate on the muscle groups you used while exercising, holding each stretch for 20 to 30 seconds at a time.
If you're concerned about suffering a sports related injury while being active, learn about how you can prevent and treat injuries. All active people should know how to apply R.I.C.E.: Rest, Ice, Compression and Elevation.
Rest - Take a break from exercise or any type of movement that may stress the injured area. A minor injury should be rested for one or two days, while more severe injuries may need longer.
Ice - Ice the affected area. Icing reduces pain, limits swelling and bleeding, and encourages rapid healing. Wrap ice in a towel to avoid direct contact with the skin. Ice the area for 10 minutes on and 10 minutes off for an hour.
Compression - Compress the injury with a stretch bandage. Make sure not to wrap it too tight, just enough to support the injured area comfortably.
Elevation - Elevate the limb. If possible, try to keep the injured part above the level of the heart. At the very least, try to keep it higher than the hips. This helps limit swelling and also prevents movement of the area that is injured. Keeping the injury above the heart will cut down on the amount of blood flowing to that area so as to decrease swelling.
If an injury persists for more than a day or two, or is very painful you should go see a doctor.