Brain health is key to successful ageing, and it involves several mental functions including memory, reasoning and planning. Memory defines who we are – without memory we have no past, cannot plan for the future and are unable to enjoy the present. Our reasoning and planning skills help us create and maintain healthy lifestyle habits that protect our bodies and minds.

People are living much longer than ever before. Those born in 1900 would have been lucky to reach their 50th birthday. Today, life expectancy in many countries exceeds 80, but unfortunately age-related diseases such as Alzheimer’s and diabetes can diminish quality of life.

As we age, brain cells that normally fight off infection and repair tissue begin to attack healthy brain cells. This causes inflammation and can lead to cognitive deficits and disease. But adopting healthy, anti-inflammatory lifestyle habits, such as eating fish, getting a good night’s sleep and doing physical exercise, can slow and even reverse the process.

The typical 45-year-old has worse memory than a 25-year-old, and our brains will continue to decline if we do nothing to protect them. However, if we intervene early, we can slow the decline. It’s always easier to protect a healthy brain than to try to repair damage once it is extensive.

Although there is a genetic component to healthy ageing, lifestyle habits may be more critical than genes. The landmark MacArthur Studies of Successful Aging showed that, on average, non-genetic factors are more important than genetics in determining how well and long we live, suggesting that we have more control than we realise over remaining healthy as we get older. Compelling scientific evidence points to a formula for successful ageing, in particular four habits that facilitate ageing well.

Physical activity

You don’t have to become a triathlete to live better for longer – 20 minutes of daily brisk walking will lower your risk for dementia and improve your overall health. Exercise produces proteins that stimulate brain cells to sprout branches and communicate more effectively. Workouts boost endorphins, which lift mood. Exercise will make your brain bigger, and a bigger brain is a better brain.

Mental exercise

Playing games, socialising and travelling activate brain cells, and a university education is associated with a lower dementia risk. Although smartphones and new technology often distract us, certain brain games boost multitasking and problem-solving skills, and searching online can activate neural circuits.

We can also train our brains using memory methods to compensate for everyday forgetfulness. These methods can help us focus attention and use mental images and associations to make information meaningful and memorable.

Stress management

Stress shrinks the brain’s memory centres, and the stress hormone cortisol temporarily impairs memory. However, meditation, yoga, tai chi and other relaxation methods can reverse stress and improve mood and memory. Meditation even rewires the brain and improves measures of chromosomes’ telomere (protective cap) length, which predicts longer life expectancy.

Spending time with friends and getting a good night’s sleep also reduce stress.

Healthy diet

Mid-life obesity increases the risk of late-life dementia, but portion control and exercise can help people avoid obesity. Obese people who lose weight experience significant, lasting memory improvements after just 12 weeks. Omega-3 fats from fish or nuts fight inflammation associated with neurodegeneration. Fruit and vegetables combat age-related oxidative stress that causes wear and tear on brain cells.

People can protect their brains by avoiding crisps, biscuits and other processed foods that increase the risk of diabetes, which doubles the risk of dementia. Several studies have suggested that alcohol and caffeine in moderation lead to better brain health.

It is never too early or too late to start living more healthily. Your daily habits have more impact on how long and how well you live than your genes, and you can take control of your longevity by following the formula for successful ageing: exercise your body, stimulate your mind, manage stress and eat right so you can enjoy yourself as you live better for longer.

• Dr Gary Small is a professor of psychiatry and ageing, and director of the Longevity Center at the Semel Institute for Neuroscience & Human Behavior, University of California, Los Angeles