This can be due to
calcium and Vit D deficiency, get it checked. If its low, take the supplements. But if you are having any history of injury or any wrong movement creating pain,or any knee locking, you should consult a physiotherapist.
Next Steps
Go to a physiotherapist.. Ultrasonic therapy +IFT +Heating therapy +some strengthening as well as stretching exercises will be helpful for sure.
Health Tips
At home.. Rest +hot water fomentation +pain killer gel +no long standing /walking +no stair climbing +no cold exposure +use knee cap.