Everyone has a way to stretch their hamstrings. When I play tennis, I usually find a bench or even a low fence to work with. The trick is getting your body mechanics right so that you actually stretch the target muscle and don't just look like you're stretching!
If you're stretching at home, or at the gym, or somewhere where you're lying on a flat surface, then an effective hamstring stretch can be quite difficult. Which one of you can reach behind your shin, keep you leg straight and your neck, head and shoulder on the ground to perform a stretch? I thought so!
Of course you can use a towel or strap around your heel to extend your reach, but one technique you can try is to use your lower leg as a lever to apply the stretch to your hamstring. Here's a video showing you how to do that:
Let me make a few observations. Apart from the obvious comment that it might just be a tad of an overstatement to describe this as "the best hamstring stretch ever", it can be very effective and fairly easy to apply.
From personal practice and teaching it to clients, I've discovered a few things. Firstly, I've added breathing to the way I teach the stretch. Taking a deep breath and releasing it helps you get that relaxation phase that always seems to help me when I stretch. There is also a tendency in clients to hold their breath as the stretch and count, so the breath is helpful to stop them doing that. Second, I'm not sure you need necessarily to dorsiflex the ankle to get a stretch in the hamstrings. you certainly get a stretch into your calves that way, and I've heard people refer to this action as adding a neural stretch to the exercise, but you can get a good stretch in the hamstrings without it.
Lastly, it may be beneficial to some client to work on getting their leg straight before moving the position of the knee. Knee position seems to help in targetting slightly different regions of the muscle.
Anyway, I'd suggest exploring it yourself to see how useful you find it as an alternative to other self-stretches. And one last thing before I go, keep an eye on the other leg and the pelvis. They should remain nice and neutral to get the most out of the stretch of course.