You may be scared to do lunges because they hurt your knees. However, you keep hearing that you should do them to be a better hiker. So you feel frustrated because you can't do the thing that would help you the most.
Here's the deal: doing lunges the traditional way puts a lot of pressure on the front of the knee - exactly where most hikers feel pain. So it's no wonder you're worried that lunges may do more harm than good.
I've got good news! One small tweak will help you perform lunges in a way that doesn't hurt and helps develop strong glutes so you can climb more easily. Are you ready?
Traditional lunges are performed with the body in a vertical position. When you hinge forward at the hips, you engage the glute muscles more effectively to perform the exercise. Now you're harnessing the power of these big muscles to execute the movement instead of placing the entire load on the front knee. This position of being slightly hinged forward is exactly how your body looks when you hike an incline. Therefore, not only is this a more comfortable way to perform the exercise, it's also more hiking-specific.
Here's the other secret about lunges: you only need to lower the back knee as far as is comfortable. Many hikers have all-or-none thinking when it comes to exercise. However, every exercise is modifiable to your ability. So don't worry if you can't lower all the way to the ground. Do what you can, and as you get stronger, you'll be better able to perform the full expression of the exercise.
Lastly, lunges require a lot of core and pelvic stability. If you're wobbly or worried about falling, hold on to a wall, counter, or furniture while you do the exercise. It's better to modify by holding on so that you are stable enough to focus on the correct form.