During a period of ill health a few years back, as I struggled with depression and addiction, three of the four elements that helped me to recover were straightforward: psychiatry; psychotherapy; and the support of others. The fourth was more mysterious, and I set out on a journey to try to understand it.

In my teenage years, I had developed an aptitude for drinking, as many adolescents do. But it was while working as a music journalist in my 20s that my addictions accelerated. By April 2012, at the age of 27, I was on my knees. I knew that the drink and drugs had to go: the highs were getting harder to achieve; the lows were becoming more dangerous, more self-destructive. I knew my mental and physical health were deteriorating, but I couldn’t seem to stop or cut down. After months of trying to do this alone, I found a rehabilitation programme and set out on a path to sobriety.

I had time on my hands, weekends loomed large and I needed to keep busy. So I started walking, wandering daily on Walthamstow Marshes in north-east London to watch the kestrels, caterpillars and the shaggy old heron. It made me feel safe and secure. Gradually, I realised that my mind needed these walks and I grew to rely on them. The natural world had become a kind of rehab: it soothed my rawness and patched me back together.

An autumnal scene at the Walthamstow Wetlands in north-east London. Photograph: Ray Wise/Getty Images

In those very early sober months, when I was learning to live without the crutches I had used for years, I felt as if I was walking around without skin. The critical inner voices that had contributed to my periods of mental illness had folded me into myself. But on the marshes, I started to look up and outwards. Even though I was usually alone when I walked, I never felt lonely. I was realising that I belonged to a wider family of species, the matrix of life, from the spiders to the lichen and the cormorants to the coots. Nature picked me up by the scruff of my neck, and I rested in her care for a while.

With the kind of urgent desire I had once had for mind-altering substances and music, I was now drawn to trees, birds, flowers and plants . I understood that time in nature softened the voices in my head and stabilised my mood, but I didn’t, at the beginning, understand what was happening to my body, brain and mind. I hadn’t realised that the essence of nature – the geometry, the scents, the sounds, the colours, the textures, the chemical makeup – could have such a life-changing power but, quite quickly, this became apparent.

I began to plant things to watch them grow. One of the first things I noticed was that after gardening, digging my hands deep into the soil, I felt happy, upbeat, less stressed and generally more positive. Reading up on this, I saw that there may be a biological reason for it. One of the species of bacteria found in soil, M vaccae, has been found to affect the brain and increase stress resilience. In 2004, lung cancer patients at the Royal Marsden hospital in Surrey who were given an immunisation containing the bacteria reported feeling happier. As Dr Christopher Lowry, one of the leading neuroscientists in the field, said at the time: “These studies leave us wondering if we should all spend more time playing in the dirt.”

Contact with bacteria in soil has been found to increase resilience to stress. Photograph: Cultura/Charles Gullung/Getty Images/Cultura RF

Our microbiota are healthiest when they are diverse – and a diverse microbiota is influenced positively by an environment filled with organisms, which are found more abundantly outside. We are woven into the land, and wider ecosystems, more than we realise. Crucially, these old friends that we evolved with are able to treat or block chronic inflammation, which can also affect the brain and have a direct impact on mood. Studies have shown that spending just two hours in a forest can significantly lower levels of cytokines – an inflammation biomarker – in the blood, which could be caused by exposure to important organisms.

It is all very well thinking about how more connection with the natural world would make people happier and healthier. But it is all the more pressing given the situation we find ourselves in. How can forest bathing be prescribed when forests are threatened and diminishing across the world? How can people spend more time in green spaces when many of our parks are in decline?

As I fell in love with the trees and the soil, I began to see how endangered much of nature had become, and how these opportunities to commune with other species were slipping through our fingers. Alongside our disconnection from nature is, of course, the fact that the natural world is rapidly vanishing; our time on this Earth is haunted by habitat destruction, species loss and climate breakdown. While revelling in the glory of the rest of nature, I also fell into a state of ecological grief, the name for the psychological response to the nature and climate emergency; a mourning for the communities, wildlife and landscapes that are disappearing and a fear of what is to come. Of course, people in many countries – including Britain’s flooded areas – are already suffering directly from the impact of the climate emergency. Others are experiencing anxiety, worry and dread about an anticipated future of ecological loss.

The more I learned about the benefits a connection to nature can have on our minds, the more it seemed appalling that access to nature is so threatened in some places. The destruction of ancient woodlands across the country; the felling of much-loved street trees in Sheffield and other urban areas; children barely given opportunities to play in woods, fields and parks; the legislation that is failing to protect our rivers, streams and wild places; and the fact that the UK will miss almost all its biodiversity targets that were set a decade ago.

Spending time in restorative natural environments is dependent, partly, on weather, which is in flux. A study of antidepressants by the environmental psychologist Terry Hartig has suggested that colder summers may constrain restorative activities that reduce stress and depressive symptoms. Rates of SSRI prescriptions increased for men and women in an unseasonably cooler July in Sweden. At the other extreme, emerging evidence links potentially dangerous high temperatures to increased mental health problems, illness and suicide.

For those on the frontline of the climate crisis, the mental health impacts of ecological loss are already severe. In Kulusuk, Greenland, where the ice has melted, rates of depression, suicide and alcoholism have risen. In the Nunatsiavut region of Labrador, Canada, residents report feeling stressed, depressed and anxious because of the melted ice and changing weather patterns. It strikes at the very heart of identity. Farmers in the Australian wheat belt, whose farms have blown away in dust storms, have compared losing their farms to a death.

Diversity and richness of birdsong is linked to decreased stress and a quicker recovery of a balanced nervous system. Photograph: Fireglo2/Getty Images/iStockphoto

As Glenn Albrecht, the Australian academic who coined the term “solastalgia”, to describe the distress caused by environmental change, points out, what is disordered isn’t ecological grief, eco-anxiety or global dread but “the world that is causing you to feel that way”. It is a natural response to loss – and it is likely to become more common.

Our relationship with nature, even if it could be restored, isn’t quite as simple as a soothing, serene ramble in the wild. The wild barely exists. So what is the effect of biodiversity loss on our minds, our inner selves, and the collective psyche?

When we walk in the woods, or by a lake, or spend time in a garden or park, evidence suggests that our parasympathetic nervous system is more likely to be activated. This is responsible for the “rest and digest” processes at work inside your body, associated with feelings of contentment, sleep and safety. The sympathetic nervous system’s main function is to stimulate the body’s reaction to stress, and ignore any non-essential business, such as immune function. Ideally, we want a balanced nervous system.

After exposure to nature, our stress-recovery response is faster and more complete when compared with exposure to built environments. This has important consequences for our health at a time when stress-related diseases are on the increase. It also suggests that if we, as a society, are allowing trees to be cut down, or natural spaces in urban areas to be paved over, we are acting in a way that is damaging to public health. We need nature in order to recover from the stresses of life.

Research shows that green space seems to have a buffering effect on the stresses of an urban area

There are many studies that link natural sounds – particularly diversity and richness of bird song – to decreased stress and a quicker recovery of a balanced nervous system. Even people under anaesthetic have been found to produce fewer chemical biomarkers associated with stress – such as amylase in saliva – when played a recording of soft wind or birdsong.

A few years into my research, I had a baby and moved to a town in Hampshire. Near my new home, I found a beautiful, wild cemetery containing ancient ruins, where a majestic beech tree shines batter-yellow in the autumn sun. Rabbits flicker in the long grass, occasionally stopping long enough so I can see the black inkwells of their eyes; goblets of ancient epiphytes decorate the brick walls. When I look closer at the yellow blotches of lichen with my pocket microscope, I see tiny cities made of gold, with depth and dimension and cherry-red microscopic bugs invisible to the naked eye.

The science of awe was first considered by a psychologist called Dacher Keltner at the University of California at Berkeley in a landmark paper published in 2003. Many experiences of awe in the modern world still come from an encounter with nature, despite our disconnection from it. Keltner found that awe increases happiness and lowers stress, perhaps unsurprisingly, but he also discovered just how powerful an experience of awe can be to the body and mind. The lab found that people were more ethical, kind and generous after feeling awe. Why? Perhaps from simply being in a good mood. But using functional MRI to look at the brains of participants, scientists saw that awe reduced activity in the default mode network, the area of the brain associated with a sense of self. It reminded me of a phenomenon I had heard about from recovering addicts: “addiction.fm” or the “washing-machine head”. In other words, the self-centred, negative ruminations that a substance can hush temporarily but, in the long run, will only feed. I visited the cemetery with renewed vim, searching for moments of awe and finding them everywhere.

Around that time, I got postnatal depression and there was a frightening period when nature didn’t touch the sides. I felt nothing in the wild spaces that had previously brought me wonder and succour. But after medical help, I found that taking a walk through the cemetery instead of down a busy, polluted road, made me feel noticeably calmer and lighter. I was drawn to the effulgent green moss, the old, sprawling yews, the buzz of spotting a nuthatch or goldcrest or sparrowhawk.

It turns out that these walks may have been affecting my brain in immediate and significant ways. Researchers in Edinburgh asked a group of people to walk from a busy urban space to a public park, or vice versa. Both groups started with a high stress response. What was interesting was how green space seemed to have a buffering effect on the stresses of the urban area. Those who started in green space and walked into a busy built-up space experienced an increase in alpha brainwaves – the electrical activity of the brain associated with relaxation. Nature seemed to undo the stress of the city, in the moment.

When I started on this journey, I might have said that a relationship or connection with the rest of nature isn’t for everyone; that some people just don’t like the outdoors. But, in fact, research shows that background nature is essential across the population for good mental health. Without access to natural landscapes, rich in biodiversity, our potential for restoration, peace and psychological nourishment is sorely degraded.

If we feel it, we can be galvanised by our ecological grief. We need a new relationship with the Earth, one that positions us not as conquerors, but co-tenants with wildlife and rivers and mountains and trees, respecting and caring for natural spaces because it is the right thing to do – and because we need the rest of nature for our lives and for our sanity.

Losing Eden: Why Our Minds Need The Wild by Lucy Jones is published by Allen Lane on 27 February