First, if the pain is severe, see a doctor asap. It could be inflammation, knee misalignment, or other conditions that need medical attention to recover. Don’t put stress on your knees until you get a professional opinion.
There are several things you can do to reduce pain and run further: stretch before to relax tight muscles, use a good quality running shoe that provides enough support and cushioning, making sure your form is proper and running on the balls, not heels of your feet (which can lead to knee injuries), incorporating lower body workouts like leg presses to your routine to strengthen muscle, and using knee wraps or bands for extra support. Also do interval training by alternating between walking and running/sprinting, which improves speed and endurance. Physical problems aside, running is mostly mental so push yourself further each time you run and you’ll see improvement.