In the past I had some issues with my IT band when I used to run longer distances. I was able to clear it up by using a foam roller in combination with other stretches. These days I have issues with my achilles/calf, which I’m sure I could clear up with a combination of strengthening, stretching, and weight loss - but instead have just been sticking to slower speeds and shorter distances. Cushioned shoes helped, too.
It may be worth seeing a sports or physical therapist. It’s amazing how much of a difference a strengthening exercise can make. Or if you’re like me and don’t like seeing doctors, there are a lot of physical therapy videos on YouTube to try out.
Last suggestion I have is to look into cycling. I ride with lots of guys who took up cycling after ACL injuries, achilles injuries, etc., forced them to give up other sports. With a proper bike fit, I think you shouldn’t have any issues with your knees. And can be done both indoors and outdoors (smart trainers and Zwift have come a long way in making stationary bikes more fun, though still not as fun as outdoors).
Basically, I guess "exercise the thing up to the point where it starts hurting" is the general advice for this kind of thing. I just hope the pain can go away so I can enjoy tennis again.
A very lean and thin person weighting in at sub 70kg will hardly ever get issued with their knees, even if they run daily
If you weren’t doing any activity before, the pain is probably related to muscle imbalances, (relative) overtraining or similar. Obviously not a doctor but the takeaway shouldn’t be that exercise is bad, more that years of inactivity leads to serious atrophy that later causes injury when activity levels pick up.