If you want to keep your mind healthy as you age, research indicates exercising is one of the best things you can do.
A review of research on the cognitive-boosting effect of aerobic exercise (which in many studies was either running, jogging, or brisk walking) found that for children, running improved working memory and focus. For young adults, working memory saw a similar boost — as did task-switching ability.
For older adults, this sort of activity provides a long list of cognitive benefits, including working memory, focus, and task switching.