I've had two injuries involving knee pain - runners knee and ITB injury
for runners knee (pain in kneecap) you want to strengthen your quads, give your knee a week or two off and then build back up to your old distance gradually, icing + doing quad strengtheners after every run - examples of exercises include squats+lunges (only once you're pain free as they can be tough on your knees) and sit down with your knees at 90' and your feet on the floor and lift the affected leg so it runs parallel to the floor, hold for 10 seconds, lower and repeat
for your ITB (pain likely to be on the outside and sharp) you want to foam roll the crap out of your ITB (along the outside of your thigh) and strengthen your weak muscles, for me this was my hip flexors, so for hip flexors lay in a straight line on your side then lift your leg at the hip as high as you can and lower (keep it straight) and repeat, you can also do small pumps and circles when your leg is raised
generally I would stop running until I was sure I was pain free, then restart taking a few weeks to build back up and stopping if I had any pain at all