I think most of it is down to luck. Some villagers are programmed to be stronger than others. One thing I do is make sure they are on 'light' work - that is, not on research or building, where they can get injured. Generally, I uncheck the Elders' preference boxes and let them do what they want. Even if they are not Elders with a capital E, if they are very elderly I normally let them potter about without a defined job, as well.
There is a stew that can help restore weakened villagers, but several players have reported the death of a particular villager through old age despite regularly feeding it to them, so it can't put off the inevitable for ever.
_________________________
To err is human; to arr is pirate.