Prevent hamstring injuries by avoiding sudden movements, improving flexibility, and cross-training. If injured, stop activity, apply ice, rest the muscle, and slowly rebuild strength with physical therapy and controlled stretching.