"The mental benefits of aerobic exercise have a neurochemical basis. Exercise reduces levels of the body's stress hormones, such as adrenaline and cortisol. It also stimulates the production of endorphins, chemicals in the brain that are the body's natural painkillers and mood elevators. Endorphins are responsible for the "runner's high" and for the feelings of relaxation and optimism that accompany many hard workouts — or, at least, the hot shower after your exercise is over...
Almost any type of exercise will help. Many people find that using large muscle groups in a rhythmic, repetitive fashion works best; call it "muscular meditation," and you'll begin to understand how it works. Walking and jogging are prime examples. Even a simple 20-minute stroll can clear the mind and reduce stress. But some people prefer vigorous workouts that burn stress along with calories. That's one reason ellipticals are so popular. And the same stretching exercises that help relax your muscles after a hard workout will help relax your mind as well" (Harvard.edu).