To avoid knee pain (and you can’t always, as it may just be how your knee cap is positioned), you can run on soft surfaces, do exercises to strengthen your leg muscles, avoid hills and get good running shoes.