Did you pull a hammie? Be careful. The recurrence rate in the first two months is approximately 22%. But you can improve those odds by combining some knowledge of anatomy with your passion for training.
See, the hamstrings act on both the hip and knee, extending the former and flexing the latter. During sprinting and other explosive movements, the hamstrings are typically lengthening while under tension. This is what's termed an eccentric contraction. And, unfortunately, concentric contractions (which predominate in most strength training programs) don't easily transfer to eccentric strength. While there are many movements which can effectively train the hamstrings in the manner in which they're challenged, a simple one which can be implemented with no equipment is called the Nordic Hamstring Exercise.
With feet anchored (or using a partner as in the above illustration), pivot forward from the knees while maintaining core activation. You should aim for one straight line from ears to knees, concentrating on not "breaking" at the waist. Move only as far as you can (and it probably won't be far at first) with a goal of reaching the point where you almost get stuck and can't pull back. The image of the figure in the middle above is likely as far as most people will go with good form. Some people like to drop to the floor and then explosively push back up with the arms to the start position. But the difficulty, along with the excessive loading and development of the internal shoulder rotators, makes this aspect of the exercise contraindicated in most cases.
Studies show up to a 60% reduction in new hamstring injuries and up to an 85% reduction in recurrence compared to controls when incorporating this movement into a training program. But go easy at first. Otherwise, soreness will leave you walking funny for several days. But at least you're walking. And that's what you have to do before you run. And you can't do that well unless you're hamstrings are strong and smart. So train them to be that way.