Diet, exercise, enough sleep, and a good social support structure are pretty much the keys to good health in general. The fact that we have so many health issues in western society are because its so easy to neglect these things.
These are luxuries, not mandatories. That's why many people don't get them. They can't. I absolutely can't.
For everyone else, they are mandatory.
Exercise is the easiest. Exercise isn't running and weightlifting, exercise is pushing your body to the limits so that its limits slowly increase over time. For 600lbs people exercise may be standing up and sitting down. For the elderly, like my 92 year old grandmother with COPD, exercise is curling and doing overhead presses with a heavy book while seated. People with cystic fibrosis exercise, and are usually exercise machines because if they stop they die. Patients in iron lungs exercise. The only people who can't exercise are those in hospice care. If you can stand, standing until you cannot stand anymore is exercise. If you can walk, 5 seconds more walking than you did yesterday is exercise. Wheelchair-bound patients with Osteogenesis Imperfecta can (and are highly encouraged to) exercise. Exercise costs $0.00.
If you are so ill that you cannot pick up a 1 lbs dumbbell, putting a rubber band around your fingers and opening and closing your hand is exercise and will have benefits. If you are not acutely dying, you can exercise.
All forms of exercise at all levels for all people has a benefit-- however small, it is a benefit.
Eating right is harder, but is accessible to any able-bodied, homed, person. Able-bodied doesn't mean healthy. Able-bodied means "able to turn on a hotplate and lift a bag of beans."
Social support is the hardest, but is doable for all but the most mentally ill. There are roughly 35,000 social support groups full of people looking for a social support network dotted across the country. Many of them meet online so anyone who can read HN can participate as a first step. I do not believe they are adequate. I do believe that online support groups are an outstanding and effective first step.
Lacking a social support network is often fatal to human beings, and those who lack support need to work extremely hard to obtain one, but it isn't impossible.
There are human being for who exercise, diet, and friends are luxuries.
Someone active on hacker news is PROBABLY not one of them.