A new study recommends people actively avert certain factors in midlife ‘as a strategy for preserving brain health’