I have knee problems. What I find if you stretch really good after a workout it helps. Also, doing yoga, really does helps. If you concentrate on the leg exercises with yoga it helps. Also, if you use ice and put it on your knee it helps too. You can buy a ice wrap that you can wrap around your knee. If you leave that on for twenty minutes it really does helps.
If you are in agony, my go to is the wrap around ice pad. When you put it around your knee if twenty minutes I find it helps.
Also, before you exercise you may want to buy a brace for your knee, so it helps with the pain afterword,
When you are lying in bed, I find putting a pillow underneath my knee helps with the pain too.
Also, if you have to sleep on your side you can use a pillow and put the pillow between your legs where your knee is a turn to your side. That also helps with pain.
With any leg pain it is good to walk on it. Because it becomes less stiff. I find the stiffer the joint the worse pain it is. But, don’t walk for hours and hours. You know what I mean!
Hopes this helps! Jen Den