In his Pensées, a French philosopher appeared to establish an argument for religious commitment, which he saw as a kind of bet. He claimed that if the existence of God was possible, then taking the leap of faith was a good idea.

It is assumed that religion has no benefits in the real world but some sacrifice. There could be evidence that faith contributes to better wellbeing. Studies show this is the case. You can join a church, synagogue or temple and live longer.

The findings might seem to be proof of divine intervention, but few scientists are making claims for miracles. They want to understand how it improves people's ability to deal with life's stresses. Doug Oman is a professor in public health at the University of California Berkeley. "From the psychological perspective, religions offer a package of different ingredients."

Studying the life-extending benefits of religious practice can offer useful strategies for anyone, regardless of faith. The evidence base linking faith to better health has been in existence for decades and now includes thousands of studies. Longitudinal research involves tracking the health of a population over a long period of time. Measures of someone's religious commitment, such as how often they attend church, were associated with a range of outcomes, including a lower risk of anxiety, depression and suicide.

worshippers at st giles cathedral, hIgh kirk of edinburgh

People who pray tend to have a more positive outlook on life – and those who pray for the wellbeing of others tend to live longer. Photograph: Kumar Sriskandan/Alamy

The studies have examined populations across the globe, with remarkably consistent results. The effects are large. Dr Laura Wallace at the University of Chicago Booth School of Business looked at the obituaries of more than 1,000 people across the US to see if the article recorded their religious affiliation.

She reported in her results that people marked out for their faith lived an average of 5.6 years more than people who had not been marked out for their faith. It is on par with avoiding major health risks. Reducing hypertension adds five years to a person's life expectancy.

Scientists such as Wallace have studied the health effects of this size. Studies show that people who attend church are less likely to smoke, drink, take drugs or use unsafe sex than people who don't.

It is possible that the religious teaching encourages the principles of moderation and abstinence. It might be the fact that religious groups are self-electing. It is possible that you have enough self-control to resist life's other temptations if you have enough will to get out of bed on a Sunday morning.

Even though scientists have been able to control for these differences in behavior, the health benefits of religion still remain. Social connection is the most important. Feelings of isolation and loneliness are a serious source of stress and can lead to other problems. You can't get to work if you can't call on a friend to give you a ride when your car breaks down.

Increased inflammation can be caused by chronic stress and can damage tissue and increase your risk of illness. According to one study, the influence of loneliness is comparable to that of Obesity and low, as a result of the fact that the size of a person's social network and their sense of connection with others can both predict their health and longevity.

the 17th-century mathematician blaise pascal at work

The 17th-century mathematician Blaise Pascal, author of the Pensées – and the famous wager. Photograph: Alamy

Religions tend to be built around a community of like minded worshippers who meet regularly and have a common set of beliefs. Many of the rituals will contribute to a sense of communion. According to a new study by Prof Gail Ironson at the University of Miami, Christians are encouraged to pray on behalf of other people.

Ironson has spent decades studying how people with HIV cope with their infections and how psychological factors affect their outcomes. She found that people who prayed for others were two times more likely to survive than people who prayed for themselves. Ironson accounted for factors such as adherence to medications or substance abuse in order to keep the link going.

Positive emotions such as gratitude and awe are good for our mental and physical wellbeing and can be cultivated through religion. Studies show that counting your blessings can help you shift your focus away from the problems you are facing and prevent you from getting into the negative spirals of thinking that amplify stress. You can be encouraged to thank God in your prayers in the Christian church. It's a form of cognitive re appraisal. It helps you to reexamine your situation in a more positive way.

When we think of something bigger and more important than ourselves, we are amazed. It is possible for people to cut through self-critical thinking and ruminative thinking so that they don't make a big impact on your wellbeing.

A sense of purpose in a person's life can be created by religious faith. People with a sense of purpose tend to have better mental wellbeing, compared with those who don't, and this seems to have knock-on effects for physical health. It helps to have a core set of values. Prof Eric Kim at the University of British Columbia has studied the health benefits of purpose in life. Positive feelings can act as a buffer to stress.

volunteers sort produce at a food bank warehouse in kingston upon thames, surrey

Volunteers sort produce at a food bank warehouse in Kingston upon Thames, Surrey, in February this year. People who spend time helping others seem to live longer. Photograph: Vickie Flores/EPA

Average effects don't always take into account the huge variety of people's experiences While some Christians might see God as a benevolent figure, others might have been taught that he is judgmental and punishing, which can affect our health. In her studies of HIV patients, Ironson found that people who believed in a God of vengeance had a faster disease progression than people who believed in a god of mercy.

It seems unlikely that many people would adopt a particular religious view for the sake of the health benefits. This research may inform your lifestyle even if you are not a believer.

Consideration of contemplative techniques, which come in many more forms, is what you can start with. In loving-kindness meditation, you spend a few moments thinking about friends, strangers, and enemies. The practice is similar to the Christian practice of intercessory prayer. This increases people's feelings of social connection and helps them with their mental health. It also makes people change their real-life actions towards others.

The power of religion is that it gives you this package of ingredients that are pre-made and organised for you
Prof Patty Van Cappellen

It is possible to build more gratitude into your life by keeping a diary and thanking the people who have helped you. Both strategies have been shown to improve people's stress responses. If you want to cultivate awe, you can go on a nature walk, visit a magnificent building, or watch a film that makes you wonder.

If you have time and resources for greater commitments, you could also take up a voluntary activity for a cause that means a lot to you, a task that could boost your sense of purpose and enhance your social life. Part of the longevity boost of religious people can be explained by the sheer amount of volunteering someone performs, but charitable actions do not need to be linked to a particular faith for you to get those benefits. Prof Kim believes that the framework of religion can be taken into a non-religious context if people plug into causes that light up their values and find a community that helps them reach their goals.

The challenge is to make sure that you build all of these behaviors into your routine so that they are the same regularity and devotion normally reserved for spiritual practices. There is a package of ingredients that are pre-made and organised for you. If you're not religious, you have to make it on your own. You can see those benefits without making a leap of faith.

  • The Expectation Effect: How your mindset can transform your life is a book by David Robson. It will be available in paperback on December 29th. Go to guardianbookshop.com to order your copy. Delivery charges can be applied.