There are several different techniques for stretching muscles, each with advantages and disadvantages. You should consult an experienced teacher or health care professional to find the best technique for your physique.
There are two main types of stretching: static and dynamic.
Static stretching is a stretch that is held in a particular position. For example, lying on your back with one leg raised in the air and gently easing the leg in toward the chest to stretch the hamstrings. Static stretching is more effective than dynamic stretching for producing long-term flexibility, but should only be practiced when the body is fully prepared.
Dynamic stretching is a stretch that is an active movement as a result of muscle contraction. For example, circling the ankle or shoulders, or controlled leg and arm swings. This type of stretching takes you to the limits of your range of motion, with no bouncing or jerking. A good dynamic stretch is one that reproduces the movement patterns required for the exercise you are about to undertake. For dance, an example is a controlled développé to the front or side, which dynamically stretches the hamstrings. Dynamic stretching should be performed only after a proper warm-up.