Hi and welcome,
Health:
Get a bicycle computer with a cadence(pedal rpm) counter.
Knees generally aren’t opposed to motion as such, but large degrees of bend combined with high loads can annoy them. One way to protect against that is to make sure you’re spinning instead of mashing. Pedalling light-and-fast is better than pushing slow-and-hard. Aim for a cadence in the 80-100 range. A bike computer can help with that.
Another is to make sure you have the saddle height right. Butt on saddle, the leg should be nearly entirely straight when your foot is on the pedal and the pedal at its lowest.
Adding a stretching routine and a complementary (upper body) workout routine is also good.
Bicycle:
MTBs tend not to be that great for road riding, particularly suspension bikes. If you can, lock the fork travel. Swap to smooth, semi-skinny tires.