The mitzvah of V'nishmartem (Devarim 4:15) requires a person to take care of their health (Shulchan Aruch C.M. 427:8, Kitzur Shulchan Aruch 32:1). How far does this go? Do I have to exercise daily? Do I need to be in peak physical condition? Am I required to stay current on nutrition news to follow the healthiest eating and living habits? In short, how far do I have to go?
Your question can be broken up into two parts (at least)
- What physical state of health is one required to maintain?
- How much time/effort needs to be invested in this endeavour?
I will try to answer part 2 & maybe after that we won't need to answer part 1.
I want to start with a small introduction:
It is a basic tenet of Judaism that everything which happens is all a direct result of G-d willing it to happen. It follows that when we, say, go to work to provide for our families it is not really our effort that brings about the results, rather the will of G-d, we are only "going through the motions". This raises the following question: If we aren't really accomplishing anything with our act & efforts, why do them at all? The short answer is simply that G-d desires that the world run in a specific manner where it seems as if we are an active force but in reality we are not at all.
Based on this, it is accepted that the more one internalizes this concept, that everything, no matter what, is in the hands of G-d, the less effort he actually has to put in to achieve the same end result.
This means that every individual has a different minimum required effort which he or she is commanded to do. This applies to many aspects of life, though the commandment most often discussed is the obligation of a man to support his family, however the rule should hold true over here as well. For one person it may be doing exercise for 20 minutes a day, while at the same time his friend is required to do double that & go an intense diet.
In conclusion, I believe there is no clear-cut one-size-fits-all answer, rather every individual needs to seek guidance from their LOR, to see how much effort is required of them to properly fulfill the commandment of staying healthy. I will leave it to the community to decide if I answered part 1.
There are three mitzvos related to this, as enumerated by Rambam in Hilchos Rotzeach Chapter 11 and Shulchan Aruch C.M. 427.
1) ועשית מעקה לגגך
2) לא תשים דמים בביתך
3) השמר לך ושמור נפשך
(Note that ונשמרתם מאד לנפשותיכם is not even mentioned; see Maharsha Berachos 32b and Minchas Chinuch # 546 which point out that the pasuk of ונשמרתם has nothing to do with physical health. Although, the same argument should apply to the pasuk of השמר as well.)
These three commandments all relate to avoiding/preventing danger. The first one is a mitzvas aseh to protect against dangerous situations; the second one is a mitzvas lo sa'aseh to not keep dangerous things in your house; and the third one is a mitzvas aseh to remove and avoid things that present a danger.
Additionally, the Rabbis added a whole list of things that are prohibited because they are dangerous (also enumerated in Chapter 11).
However, this entire discussion is about avoiding specific dangers. It does not say that there is also a general mitzvah to be healthy, and there can be many unhealthy things that do not fall under the category of "directly life-threatening".
It would thus appear that you do not have to do anything, as long as you stay away from life-threatening dangers. (While it is possible that there are other sources about being healthy, your question was based on the Shulchan Aruch here which is only discussing dangers.)