If you are planning to do much hiking, take a wilderness first aid course. Many hiking clubs offer such a course. You can also check out SOLO which offers wilderness first aid courses throughout the country.
From everything I’ve seen and read, one good way to hike safely and avoid injury is to stay hydrated. Drink! Drink when you are cold, drink when it rains buckets. Don’t ever forget to drink. An instructor I had at a wilderness first aid course in New Hampshire advised, drink the first time you stumble, because a stumble could be an indication of dehydration. I make this a habit, thinking if I don’t, the next time I could fall and become injured.
What happens if you run out of water. Change your plan and find it. In an emergency, you can drain puddle water through a bandana or sock and apply a tincture of bleach, if you have it. As I’ve said in earlier posts, I always carry an extra bottle of water for emergencies.