There is a lot of controversy and conflicting opinions on what you should do for a warm-up for exercise. One of the reasons is that warm-ups should vary based on the activity you are preparing for and your level of fitness.
As the name implies one of the key goals in warm-up is to literally raise the body temperature and gradually ramp up the cardiovascular system to be prepared for harder efforts. The length of warm-up should be based on the intensity of the activity. Low intensity activities like moderate pace walking really require no specific warm-up as you can simply ease into the activity itself as a warm-up. For activities like competitive athletic events that involve high intensity effort the warm-up should be longer.
In the same way, you have to consider your fitness level because a warm-up for a highly fit individual may be relatively high intensity exercise for a deconditioned person.
For all warm-ups, a 1 – 5-minute period of escalating cardiovascular exercise that raises heart rate and body temperature is advisable. For high intensity athletic events this should be extended until the athlete breaks a sweat without being fatigued.
This literal warm-up can be done on a cardiovascular exercise machine or via dynamic bodyweight exercises like squats, lunges, planks, push-ups, etc.
you raise body temperature you can include some dynamic stretching with an emphasis on movements that address key joints and muscles involved in the actual activity you are warming up for. For example, for tennis warming up the shoulder joint and surrounding muscles is important while for cycling this is less relevant.
A Proven Warm-up Protocol
Warm-ups for sports participation have been researched and there is one in particular protocol that is proven to reduce injuries by improving muscle strength, balance, and coordination. This protocol is called the FIFA 11+ Program and involves doing 15 exercises. For a complete how to guide click here: https://www.slideshare.net/PedMenCoach/fifa-11-warmup-to-prevent-injuries
Although this protocol was developed for soccer it can easily be modified to fit just about any competitive sport!