The more time you spend hiking and backpacking, the better prepared you'll be but you can also do these workouts and exercises for hiking to build muscles
1.5k