It was spring when my wife’s waters broke, three months early. We rushed to hospital, terrified. If our daughter arrived now, she might not survive. If she did, she would probably be plagued by lifelong health problems. Jo spent the next four days in hospital, while we prayed labour wouldn’t begin. But the night after we returned home, Jo’s contractions started and we raced back to hospital. Straight away, a foetal monitor was placed on her tummy. The brisk heartbeat we had been following so closely in the previous days was gone. Our daughter had died.

The train of our life was shunted on to a parallel track. We could see the train we were meant to be on pulling away, passing the milestones – the due date, introducing the baby to our family, the first smiles. But ahead of us now lay despair, guilt, a funeral, photos of our precious girl that some family members could barely bring themselves to look at, and support groups where every story would be more heart-rending than the last. There is no right way to deal with losing a baby, but I would call my coping strategy unusual: I became obsessed with growing magic mushrooms.

Even before the stillbirth, I had experienced years of anxiety, exacerbated by long hours spent working alone as a writer, self-esteem issues, a young family (we had a three-year-old, Grace), a midlife crisis. Whatever the cocktail of causation, it had begun to feel like a full-on depression.

I had tried cognitive behavioural therapy, which took the edge off it, but I felt that I needed something radical to break myself out of the deepening loops of negativity and lethargy. I had read that psychedelic substances, such as LSD or the psilocybin in magic mushrooms, taken in very low doses, were being touted as the latest so-called smart drugs. I was interested in microdosing, not for the creativity boost that advocates in Silicon Valley extol, but for the effect it is said to have on anxiety; on breaking patterns of negative thought.

In the course of my work, I had spoken to Dr Robin Carhart-Harris at Imperial College London, a leading researcher into psilocybin as a potential treatment for depression. He told me about the promising results he had seen in people with treatment-resistant depression. He also described how the brains of people on a mushroom trip “light up” in an fMRI scanner, revealing communication between areas that don’t normally “talk” to each other.

In another study, at Johns Hopkins University in Baltimore, a mushroom trip was shown to ease the anxiety of people with life-threatening cancer, leading to dramatic improvements in mood and wellbeing. I also found an article in the Lancet that concluded that magic mushrooms are the least harmful “recreational” drug you can take. Mushrooms are not addictive and you can’t kill yourself by overdosing on them, as long as you take them in a safe environment. It is a mystery to me why they share class A illegal status with crack cocaine and heroin.

So, in the months before we lost our daughter, I decided to try microdosing. That presented a problem: I didn’t know any drug dealers. So, I turned to YouTube. I discovered that to grow magic mushrooms at home I needed two things: mushroom spores, in a syringe filled with sterilised water; and a growth medium, or substrate, into which I would inject the spores. A simple substrate is a mix of one part organic brown rice flour, one part water and two parts vermiculite (a moisture-retaining mineral sold in garden centres). I also discovered that, while it is illegal to grow magic mushrooms, it is not illegal to buy the spores – to look at under a microscope, for example. I found a spore syringe online for £15 plus postage and a substrate kit, pre-mixed and sterilised, on eBay, for £26. I was excited about taking a step towards improving my mental health. Under normal circumstances am a pathetically obedient citizen. But this time I felt I was informed about the science and had evaluated the risks.

The technical process of growing magic mushrooms appealed to my nerdy side. Any bacteria or unwanted fungus can contaminate the substrate. I was careful to don latex gloves, clean my arms and all surfaces with rubbing alcohol before I injected the spores through the plastic lid of the substrate tub. It would take about six weeks in darkness for my spores to germinate and colonise the entire substrate with mycelium, turning it white. After that, I would “birth the cake” into a daylit “fruiting chamber” – a lidded, ventilated, clear-plastic tub with a layer of soaked perlite (volcanic glass granules) across the bottom, to keep things moist – and wait for the mushrooms to grow.

I was risking seven years’ jail time and the destruction of my family for what had essentially become a mad hobby

It was during the colonisation period, before seeing any mushrooms, that Jo and I lost our daughter, whom we had already named Isobelle. We would discover later that the most likely reason for her death was insufficient follow-up after Jo had been treated with antibiotics for a common infection. When Jo returned to her GP a few weeks later, complaining of further symptoms, Nice guidelines were not followed and she was sent home. We would later blame ourselves that we had not been demanding enough.

Because Isobelle was stillborn after 24 weeks of pregnancy, our paternity and maternity rights kicked in. We were spending a lot of time at home. In my grief, I became obsessed by the progress of my mycelium, which was growing in the dark inside a tub on top of a wardrobe. I had even rigged up a night-vision camera inside the tub so that I could check the growth on my phone: like live-streaming grass growing, only slower.

When the cake was fully colonised, I put it in the fruiting chamber. Within about four days, little brown dots, the heads of baby mushrooms, began to appear. Soon, my first crop, or “flush”, was ready for picking. At the time, my mother-in-law had moved in to support us. Few mothers-in-laws would approve of harvesting class A drugs in the kitchen, but mine is different. She is a keen gardener, and open-minded. When I placed the fruiting chamber on the kitchen table, put on my surgical gloves and started harvesting, she said: “My son-in-law is Walter White.” As a fan of Breaking Bad, I took that as a compliment.

About three weeks after Isobelle’s death, with my anxiety buried under grief, I decided to begin microdosing. I would take 0.3 grams of dried mushrooms every third morning (a popular timeline, recommended by Dr James Fadiman, the author of The Psychedelic Explorer’s Guide). I was such a mess that it was difficult to know what effect it might have. I just knew that things couldn’t get any worse.

On the days I took the dose, my mind felt more open and free-ranging; I would make more lateral connections when thinking. I would feel closer to nature, which would appear more beautiful, and more present in the moment, better connected to my family and to my own emotions, more likely to spark up conversations with strangers. The dose was too small to cause visual disturbances. It was more a feeling of energised openness; I would notice details that had previously passed me by.

In the months that followed our loss, Jo and I struggled to keep ourselves intact. We cried frequently, tried to be strong for our daughter, Grace. Jo threw herself into gardening. Together we attended regular support groups run by the amazing charity Sands. Jo began weekly sessions with a counsellor. I immersed myself in mushroom-growing. I used the spores from first flush to make my own spore syringes and injected six more tubs bought off the internet. I bought mason jars, customised them with air filters and injection ports, and filled them with my own varieties of substrate. Before long, I had 18 jars colonising and fruiting. They were concealed on top of wardrobes, out of Grace’s sight and reach. I read that adding coffee grounds to the substrate could increase yields. The next day, I noticed a bin in the gardening section outside Waitrose, with a sign on it that read: “Collect your coffee grounds here.” Handy. I soon decided I wanted to “spawn to bulk”, to increase my yield. This approach was lengthier, with a variety of processes and ingredients, but produced a dense canopy of large mushrooms – one as long as my hand.

There was no longer any logic to my behaviour. I already had enough mushrooms to microdose for at least a decade, if I chose to, and I wasn’t about to become a drug dealer. To say my wife was patient is an understatement. She saw this for what it was: a bizarre coping mechanism, something productive for me to focus on. I had no financial motive; I was risking seven years’ jail time and the destruction of my family for what had become a mad hobby. “I liked it. I was good at it,” as Walter White put it. Reluctantly, I stopped production less than six months after I had started. Mushrooms are mostly made of water, so when you dehydrate them for storing they lose about 90% of their mass. Even so, I had filled about 10 litres-worth of containers.

I often felt I needed to cry over Isobelle, yet as the months passed it became increasingly difficult: I would busy-think myself out of my emotional states. But on the days that I microdosed, I noticed I was much more likely to sit with my feelings and cry. It was a relief.

In the summer, we discovered that Jo was pregnant again, and so began another cycle of stress and fear. We dreaded the thought that this new child would die, too. By September, my grief had withdrawn inside me like a dark, choking mass. I felt there was no point to anything. Keeping up with my professional commitments became a struggle. I seemed to be returning to a depressed state, and microdosing wasn’t helping enough. It was then that I began to consider taking a full dose of mushrooms.

***

I had taken a mushroom trip once in my life, five years before, with friends. We spent some of that trip in a garden and I experienced the famed psychedelic visuals. The bark on a tree flowed and bulged; the grass moved in diamond formations; time became incomprehensible. But my main takeaway from that trip was a realisation that, beneath my uncertainty about the new relationship that I was in, deep down, our connection was solid. (This faith would be borne out: reader, I married her.)

As scientific research goes, it was about as far from a controlled experiment as it is possible to get

For this new trip, I calculated my dose based on that given to the subjects of Carhart-Harris’s study of people with treatment-resistant depression. For my body mass, it worked out at just over 3g. I blitzed the dried mushrooms into a powder, added a glass of orange juice, blitzed it again, downed it and hugged my wife. This time, I was not interested in the light show. Terence McKenna, the late ethnobotanist and psychedelic explorer, recommended taking psilocybin alone, in silent darkness, if your aim is an inner journey. It was midday, so I closed the curtains and curled up in bed.

Within an hour, the walls were breathing in and out, the colours on the picture opposite the bed were cycling through hues so fast that I had to look away, and the white paint on the ceiling had liquified and begun rolling down the wall towards me. I was thankful that this was not my first rodeo.

I closed my eyes and assumed the foetal position. I recall flashing through a range of everyday memories and being surprised that what conscious thoughts I had left weren’t focused on Isobelle. Then, these images layered and joined, like those arty portraits made up of thousands of smaller pictures. Suddenly, there was Isobelle – she was everything, all at once. A grief bomb detonated in my head. It felt like the deepest, most animal parts of my brain were opening, my whole body experiencing her loss. I spent the best part of three hours with tears streaming down my face.

Several times, Jo came to check on the sobbing, snotty mess I had become. She was concerned. But I didn’t feel frightened or alarmed. I felt that what was happening inside me was fundamentally benevolent – serene, even. My brain, apparently unshackled by psilocybin, was taking care of itself. I tried to offer Jo a reassuring smile and realised it was identical to the one I had seen on her face so often since Isobelle had died. A smile that said: “I’m really trying to be strong, but I don’t think I have it in me.” We were one, both clinging on by our fingernails.

I had another realisation during the trip. A few months after Isobelle died, Grace’s breathing pattern had changed. She had started holding her breath unconsciously, at random times. She couldn’t tell us why. We considered taking her to the doctor, but couldn’t see what a doctor could do. During my trip, I felt it in my bones that despite our best efforts to protect Grace, the tension in the house had soaked into her little body. I wept for that, too.

The trip didn’t cure me of my sadness, or my worries for the new baby. But I felt lighter, more adaptable and able to deal with the challenges to come. As scientific research goes, it was about as far from a controlled experiment as it is possible to get. But the mushrooms were such a boost to my psychological wellbeing that I felt it was important to add my story to the swell of anecdotal evidence for their therapeutic potential. It is stressful to write this, even anonymously, because of the harsh penalties linked to growing magic mushrooms. I never sold what I made, I have disposed of what I grew, and I have no intention of breaking bad again.

Our new baby arrived safely in the spring. The relief is hard to overstate. Grace is dark-haired, like her mother; Isobelle was blond, like me, which breaks my heart. Our new girl is somewhere in between, and chubbing up beautifully.

Jo now organises events to bring grief into the public conversation, to try to lift the taboo from this fundamental human experience. Grace’s breath-holding righted itself after a couple of months, thank God. She often talks about Isobelle and is adjusting well to her new sibling.

My anxiety continues to wax and wane, but I have not returned to my depressive state. What the upheaval of those 18 months has shown me is that, for my own sanity, I need to engage more with the world, with other people, and with my emotions. This openness is what microdosing gently supports. I wouldn’t hesitate to use it again to fight anxiety or depression. It’s just a shame that grabbing this psychological lifeline turned me into a criminal.

• Some names have been changed.

Comments on this piece are premoderated to ensure the discussion remains on the topics raised by the article. Please be aware that there may be a short delay in comments appearing on the site. If you would like a comment to be considered for inclusion on Weekend magazine’s letters page in print, please email weekend@theguardian.com, including your name and address (not for publication).