Lie on one side. Grasp top ankle or forefoot behind. Pull ankle or forefoot to rear end.
Straighten hip by moving knee backward. Hold stretch. Repeat with opposite side.
Having lower hip flexed inhibits anterior pelvic tilt and spinal hyperextension which can be beneficial for those sensitive to lordotic posture. When flexing lower hip, upper leg will also not need to be pulled back as far until stretch is felt.
See Lying Tibialis Anterior Stretch for similar exercise which can be combined with this stretch and performed simultaneously.