DameDeborah Jamesrecalled in her posthumously published book,How to Live When You Could Be Dead, how being diagnosed with cancer helped her overcome her anxiety about death.

The BBC hostdiedin June at 40 years old following a years-long battle with bowel cancer, after being first diagnosed in 2016.

“The worst happened and my fear was realized — I was told I had incurable cancer and that I would die,” she wrote. “I had no choice any more — I had to look my biggest fear straight in the eye. I’m not, of course, suggesting for one second that if you have panic attacks there is nothing to be done unless you receive an incurable cancer diagnosis which will sort you right out.”

TheYou, Me and the Big Cpodcast host added, “But honestly, for me, that diagnosis did something that nothing else had.”

James — who admitted in her book to living “with anxiety most of my life” — opened up about how the diagnosis had the polar opposite effect than she had expected at the time.

Deborah James.Dave Benett/Getty

LONDON, ENGLAND - OCTOBER 15: Deborah James attends The Best Heroes Awards 2019 at The Bloomsbury Hotel on October 15, 2019 in London, England. (Photo by David M. Benett/Dave Benett/Getty Images)

“On paper I could have — and perhaps should have — had an absolute breakdown, the panic attack to end all panic attacks,” she wrote. “But instead, my anxiety levels dropped.”

“When I was forced to confront what I’d spent 20 years worrying about, something shifted in me,” she added. “I had no choice but to overcome my fear and anxiety about death.”

In the excerpt, James also recalled the impact that anxiety had on her life prior to finding out her cancer diagnosis.

“I’ve been through periods of incredibly frequent, crippling panic attacks — one of which caused me to flee a changing room in the Karen Millen store in Covent Garden, ending up on the busy London street in just my undercrackers,” she shared.

She added, “I often woke up in the middle of the night already in the grip of an episode, believing my body was dying.”

James revealed that her fear of death prohibited her from living her life to the fullest.

Never miss a story — sign up forPEOPLE’s free weekly newsletterto get the biggest news of the week delivered to your inbox every Friday.

Deborah James

“The great irony, of course, being that when I was younger and not facing death, my fear of it was so uncontrolled that quite often it stopped me from living,” she wrote.

She added, “I stayed at home when I should have been out enjoying myself, I missed holidays because of my fear of flying.”

In May, James announced that she wasentering hospice care, posting “the message I never wanted to write” to herInstagram.

Around the same time, shegave an interviewto the BBC, in which she said she was “mind blown” to have raised more than 1 million pounds (equivalent to $1,233,00 USD) in 24 hours for herBowelbabe Fund.

Speaking about her Bowelbabe Fund organization, she told the outlet, “I always knew there was one thing I wanted to do before I died. But you don’t quite realize how little time we have to suddenly organize things. Had I actually thought ‘Oh yes, I’m going to die,’ I would have probably started organizing six months ago.”

How to Live When You Could Be Deadis set to be released on Aug. 18.

source: people.com