^ This. Yoga, stretching and diet are key to your overall health and flexibility. I'm 59 and completely changed my diet about five years ago. I don't eat sugar, eggs, dairy, fish, minimal meat (sometimes you have no choice) and zero processed foods. Plants only (70/20/10 Carbs/Protein/Fat). I know that sounds extreme (and goes against the incredibly extreme no carbs diets) but I went from only being able to play a maximum of every couple of days (because of joint pain and soreness) to being able to play every day if I choose. I credit almost all of that to a change in diet. There have been other benefits like regulating my blood pressure and cholesterol and reducing the plaque in my arteries by eighty percent. I'm no longer medications (BP, cholesterol, allergy) which had some significant side affects that were not so wonderful. I also dropped forty pounds and regulated my weight. On the negative side, I'm dealing with some foot pain and golfer's elbow which is more an issue with practicing and playing significantly more golf (which is a good thing), but I've got a handle on those things. As you get older you have to make some hard choices about your health. If you don't, you will be watching your buddies heading to the course while you are dealing with health issues. I see it everyday. I'm choosing not to be a victim of my own poor choices in the past.
I'm starting now to add in some stretching and other light aerobic exercise (other than walking the course), but diet and stretching is key. I don't think we have any idea what the crap food we eat actually does to our body long term. The easy answer it to take a fistful of pills but it all catches up to you as we get older. Also, someone else mentioned that things like taking Aleve before a round helps. It most definitely does, but it can also ruin your gut health/biome so best to try your hardest to avoid those things. Scientists are now saying your gut is your second brain. There may be some truth to that.