This is quite a classic stretch. I remember doing this back in the 1990’s.
Sit down, stick one leg out straight with the sole of the other foot facing the inside of your straight leg.
Bend forward from your hips, not your back. Hold for 10-60 seconds, or 3,4,5, sets of 10 seconds.
Some calming rhythmic breathing is always handy. Some talk about adding meditation. I must I admit I stretch while watching TV!
As a test, it’s worth noting that whilst your hamstring ( the back of your leg) will feel tight and engaged, if you poke the top of your (straight )leg, it (the quadriceps) will feel relaxed.
Obviously, do both sides.
There will be more hamstring stretches as we develop into the full splits.