Warming up before before you lift is a critical step in physically and mentally preparing for your workout. A good warmup will raise your core temperature, increase blood flow to your muscles, signal to your body that you are about to work out (enhance your neural function and readiness to exercise), loosen up your joints, prevent injury, increase strength and power and mentally prepare you to do work. In general, a warm up should take about 10-20 minutes.
Using the RAMP (Raise, Activate, Mobilize and Potentiate) protocol is a great way to make sure you have all of your warm-up boxes checked before you start your workout:
In this phase of your warmup you are raising your core temperature, heart rate, breathing rate and blood flow. This phase should take about 5-10 minutes.
Ideally, you want to use movements that mimic the movements in your workout - for example: air squats on squat day, light kettlebell swings on deadlift day, pull-ups on a pulling day and push-ups on a pushing day. I like to mix these in with a set of burpees, jumping jacks or a few minutes on a rowing or elliptical machine - full body movements that get the blood flowing. (For example, 5 minutes of 10 air squats, 5 burpees, 25 jumping jacks, etc.) Remember that this is a warmup so it shouldn't be crazy intense - you are invigorating your body and preparing it for work, not wearing it out before the real work!
Activate and Mobilize
In this phase, you are activating and mobilizing key muscle groups to help increase your range of motion, stability and coordination.
You can use this period to do some dynamic stretching and activating of the body parts that you will work during your workout - leg swings, arm circles, inchworms, glute bridges, etc.
If you have mobility issues that could come into play during the main workout, this is a great time to do mobility exercises or foam rolling for that part of your body. This can also be a convenient and appropriate time to practice exercises that a physical therapist might have given you. (Make sure to ask them first if this is a good idea for your specific condition and the exercises they gave you.)
DO NOT DO STATIC STRETCHING PRIOR TO LIFTING - These are exercises where you stretch and hold the position for a period of time and are counterproductive to strength training when done prior to lifting.
Potentiation refers to priming your body for the specific movement you are going to do.
This is done by performing warm up sets of your actual lifts at lower weights, working up to your working weight. (For example, say your working back squat weight is 135 pounds for a set of 5. You could start with a set of 10 with the bar alone, then a set of 5 at 85 and another at 115 before going into your working sets at 135.) You want to choose a number of warm up sets that gets your ready to perform your working sets but that doesn't leave you too tired to do your actual working sets, generally 3-5 warm-up sets.
If you are doing more than one big lift in the workout, you want to do this for both of the lifts. So, if you are squatting and then shoulder pressing, you'll warm up to your working squat weight, do your squats and then warm up to your working shoulder press weight before doing your shoulder presses at your working weight.