Staying socially active has always been good advice for staying happy and healthy.

Now research shows just how meaningful those conversations and connections can be.

People who are more socially active in their 50s and 60s tend to have a lower risk of developing dementia, according to a new study.

Researchers point to the concept of “cognitive reserve” — the mind’s ability to resist decline or failure.

Someone who saw friends almost daily at age 60 is 12% less likely to develop dementia than someone who only saw one or two friends every few months, it found. Similar associations were found among people ages 50 and 70.

“Here we’ve found that social contact, in middle age and late life, appears to lower the risk of dementia,” said the study’s lead author, Dr. Andrew Sommerlad of University College London.

“This finding could feed into strategies to reduce everyone’s risk of developing dementia, adding yet another reason to promote connected communities and find ways to reduce isolation and loneliness.”

In the United States, 5.8 million people have dementia linked to Alzheimer’s disease, according to the Chicago-based Alzheimer’s Association.

Nearly all of them are 65 or older.

As to the possible reasons why isolation might be linked to dementia, researchers point to the concept of “cognitive reserve” — the mind’s ability to resist decline or failure.

“People who are socially engaged are exercising cognitive skills such as memory and language, which may help them to develop cognitive reserve,” said the study’s senior author, Gill Livingston, a professor psychiatry at University College London.

“While it may not stop their brains from changing, cognitive reserve could help people cope better with the effects of age and delay any symptoms of dementia,” she said.

Spending more time with friends could be tied to physical activity that also reduces the risk of dementia, Livingston said.

Spending more time with friends could be tied to physical activity that also reduces the risk of dementia.

Other research has linked dementia and social isolation. One recent finding that LGBT Americans were almost 30% more likely to suffer memory loss and confusion raised the possibility that isolation from family could be a contributing factor.

Hearing loss also can cause social isolation that can lead to decreased sensory input and related dementia, other research found.

This latest study, published in PLOS Medicine, asked more than 10,000 people between 1985 and 2013 about their frequency of social contact with friends and relatives. The same people then were studied to see if they were diagnosed with dementia.

Previous studies have linked social contact and dementia risk but, without such a long follow-up, could not determine whether cognitive decline might cause social isolation or vice versa.

“There are many factors to consider before we can confirm for definite whether social isolation is a risk factor or an early sign of the condition, but this study is a step in the right direction,” said Fiona Carragher, chief policy and research officer at Britain’s Alzheimer’s Society.

“We encourage people across the country to get out into the sunshine and do something active with family and friends.”