Kettlebell swings are one of my favourite exercises, which are also often done wrong. Once you master the technique, they are an excellent exercise to not only work the legs, but the core and posterior chain as well.
Set your feet up hip width apart with your toes angled away, like a squat set up. From here, bend your knees and reach down for the weight before standing up tall.
Maintain a subtle bend in the knee. From here, send your bum back and then your hips forwards to gain momentum in the swing. With each swing you should be leaning as far over as you can to gain a hamstring stretch, but without changing the subtle bend in the knee.
You have to keep the movement continuous, it cannot be done in slow motion because you need the kettlebell to maintain momentum.
Some important things to remember that people often get wrong are:
Keep a subtle bend in the knee. Do not increase the bend to a full bend when going to the bottom of the swing and do not fully straighten your legs at the top of the movement. All the movement should be coming from the hips.
Maintain a straight back. Try not to let your back bend when leaning forwards as this will place additional strain onto your back.