Knees hurt?

So this has been going on for a while and I don't know why this is happening.

Every time I start my warm ups/workouts, I have a hard time squatting or lunging because my knees hurt and take a long time to get "warm" so they wont hurt.

This knee pain goes away after about 10 mins or after my warm ups but I don't know why my knee hurts??? What should I do? Is there a specific food I should eat? Basically, when I bend my knees, it aches but goes away after I'm all warmed up