Hamstring injuries are common in sports like football, soccer, track and also baseball for positions like outfield. Jeff Allen from the University of Alabama explains in this video that injuries are a function of age, previous injury, running load, fascicle length and eccentric hamstring strength. He focuses on the latter two areas based on research in soccer. The recommendation to reduce soft tissue injuries is to focus on eccentric exercises such as bridges, nordics, kettlebell swings and leg slides, which both strengthen the muscle and increase fascicle length. At 49:45 in the video, he shows a couple examples. 53:25 shows how to program the exercises, which he recommends for non-sprint and other light work days 2x per week. Separately, he mentioned the single-leg wall sit test as the best way to measure core strength and identify opportunities for improvement.
Separately, Cameron Josse discusses how running form issues (aka butt kicking) can lead to hamstring injuries.