Exercise can also boost memory and thinking indirectly by improving mood and sleep, and by reducing stress and anxiety. Problems in these areas frequently cause or contribute to cognitive impairment