How can exercise improve your mental health and cognitive function?

How can exercise improve your mental health and cognitive function?