When you search about solutions for your pain, you will see many articles like "Fix your pain by doing this exercise!" Most of them focus on the area where the pain is. It sounds like it makes sense to work on your knee when the pain comes from there. You find a hole in your backyard, fill it up, and the problem's solved!
However, this is just a quick remedy. If you want to deal with the pain in a truly beneficial way, you need to think further ahead: What caused the hole in the first place..?