I have knee pains for a year now. I have pain ascending and descending stairs. What is it?

Need more info. Very general symptoms but you can get started by telling us whether it is in the front of the knee, below the knee cap, in the tendon below the knee cap, on the inner side or outer side of your joint or the back. Is it the end of the thigh muscle by the knee cap, or under the knee cap. Many stair climbing pains are related to the knee cap, quads, or patella tendon from overuse or patella wear.
Protect kneecaps. Knee cap (patella) cartilage wear is the very common issue here. Patella compression force is 8 times body weight w jumping, and 3xbw during squats/stairs. Inclines or declines are like stairs and increase pressure on worn patella cartilage. Heels produce knee flexion in some people, so increase patella squeeze. So, decrease weight to decrease patella load. Keep knees straight during quad exercis.