a little hard to explain…
roll along the length of the muscle.
(under your feet, up the back of your lower leg, up the back of your upper leg, all connected so do them all)
if you find painful spots then coaxing them to release might ‘magically’ give you increased range of motion. in other words, it might not be that your muscles aren’t long enough, it might be that your muscles are too tense to allow you move about fluidly. when they feel relaxed you can up the ante by holding them on a gentle stretch and rolling with them in that stretched position. e.g., reach down and grab one of your foot so the hamstring of the same leg is on tension - now roll that hamstring. the more you try and touch your chin to your toes the more tension you have in the muscle to try and coax into relaxing with the roller.
it is a kind of manipulation / pressure / stretching combo. works pretty good for me anyway.
dare i ask… why you think your hamstrings are limiting your squat? if you are squatting and you get stuck at a certain range of motion because of your hamstrings (or whatever) then if you keep doing that… it should get better / easier in time. sometimes the best correction for squatting is squatting. i just mean… sometimes people go off on wild goose chases with the hamstring thing…