It is really just about doing it. Everyday lie back and lift your leg closer to your head. Then sitting on the floor put one leg straight back behind you. Every day this will get you closer. Repeat daily.
I recommend going to YouTube and searching some "how to get your splits" videos. It helped me a lot and I'm able to do splits all because of watching YouTube and following along 🙂