Warm up really thoroughly by doing some aerobic exercise. Don't do the really challenging stretches until after you've finished everything else. Getting the kind of extreme flexibility of something like the splits or the straddle (box splits) actually makes tiny tiny tears in the muscles, which then stretch and heal slightly stretched.
So once you're really thoroughly warmed up - about 30-40 mins of cardio is good, start working on the runner's lunge, and push the pelvis/groin down. Keep the knee behind the foot. Use a mirror to check your form - you should be aiming for a straight line from your supporting knee to the ankle of the leg stretched out behind you. Go as deep as you can in this stretch - I like to get my forearms on the floor.
Then you can start to stretch out your front leg, but don't use this position to go down into the splits.
The proper safe way to get into the splits - front & back (straddle's quite different) - is to sit up straight with one leg in front of you, and one leg behind you bent at an angle which is comfortable, and which allows you to keep both sides of your hips even. You should also be trying to turn out your whole leg (front & back) from the hip socket. Especially the back leg - if you don't use your turn out, you can hurt your knee.
So once you're in that pose, the stretch is to use your hands either side of your body, and keeping your hips even, lift your pelvis up off the floor a little so you start to straighten out your back leg. Take your weight in your arms, and try to keep your back up straight and look ahead.
Don't try to slide down into the splits from standing. If you've not got the muscle memory for splits, you'll injure yourself.