Pain in your knees can come from several different places. Arthritic changes, acute injuries to the knee, muscle imbalances at the knee and hip, and even abnormal movement at the foot will cause knee pain. It is important to get your knee evaluated when you are having pain. Many people tend to wait until their knee has completely altered their function and now are at the point that they need immediate relief through an injection or surgical intervention. Being seen by a physical therapist will improve your understanding of your condition, it will improve the outcome of your rehab process, and it will save other joints from becoming irritated.
In general, for chronic knee pain try to stay as active as possible by light walking/biking, icing will alleviate some of the inflammation in the area, and staying away from prolonged positions, extreme ranges and prolonged activities will help to keep pain at bay. For acute pain, rest your knee, ice for about 15 min throughout the day, light compression to knee with an ace wrap and elevating knee above your heart to decrease pain and swelling, and make an appointment to see your primary or orthopedic doctor.