At 24, he wanted to kill himself. Now a novelist, he teaches the readers of his books – and his children – how to get through when the future looks bleak

On a September day in Ibiza, the air scented with sea and pine, Matt Haig – then 24 – walked to a cliff edge planning to kill himself. He stopped one step away.

Reasons to Stay Alive, his account of this unravelling, the strange hell of depression and anxiety and his journey back from the edge, would become a bestseller 16 years later. Already a novelist by the time he wrote it, Haig saw the book as a “side project”, though it was anything but. Within weeks, he was getting 1,000 emails a day from grateful readers. Strangers stopped him on the street to thank him. Celebrity admirers included Steven Fry, Jo Brand and Ruby Wax – and Haig was catapulted into the role of mental health campaigner.

This year has seen the publication of Haig’s Notes on a Nervous Planet, which explores the effects of 24/7 modern life on mental health, and The Truth Pixie, a message of hope for his younger readers. Meanwhile, back at home, Haig’s own children, Lucas, 10, and Pearl, 9, have been learning about their dad’s illness at the same time as the public.

“It took 10 years for me to even talk to anyone who wasn’t my partner or my parents about my breakdown,” says Haig. “Reasons to Stay Alive was published in 2015, and that’s when the children learned that I had something called depression. They would hear me talking to a journalist, or come to a book event. I’d be hypocritical if I’d tried to keep it from them. My whole view is that my problems were caused by not being comfortable talking about that stuff. So there was never one big conversation. It just slowly bled in.”

Which isn’t to say Haig is blasé about how parents should approach the issue of mental health with their children. Nurturing resilience, being truthful but not terrifying, showing life’s light as well as its darkness isn’t easy – but it is crucial.

My kids know I love life, but sometimes I have these dips

“When it comes to my own illness, I’m trying to create an environment where my kids know I’m a happy person, that I love life, but occasionally have dips, mainly in the past but which can still happen now,” says Haig. “Obviously there’s aspects of any serious illness you’d want to shield from them. I have this crude guide, like the film certificates, in my head and I don’t think they’ve heard me talking about depression beyond a 12-rating. They’ve heard the word ‘suicide’ and they’ve heard it nearly killed me but, at the end of the day, I didn’t take my own life. I had a dangerous experience, like a person who went on a dangerous voyage. It’s something you ‘go through’ – it isn’t who you are – and I survived. That’s a good lesson.”

For Haig, even the decision to have children required a leap of faith. His breakdown in 1999 had happened when he was living with his girlfriend Andrea (now his wife) in Ibiza. In Reasons to Stay Alive, he describes how what started with a “strange flickering” inside his head soon felt as if the “Big Bang” had blown him to pieces. The couple flew home and spent a year living with Haig’s parents in his childhood home of Newark, Nottinghamshire. Rejecting medical solutions such as anti-depressants or sedatives, a combination of time, love, reading and exercise slowly brought him back together. After a year, the couple moved to Leeds and Haig began writing. His books, both adult and children’s fiction, became award-winning bestsellers.

“Andrea definitely wanted children,” he says, “but I’d just got my mental health to a level so I was very scared of change. I was like two people – the person who massively and instinctively wanted a child and the person terrified of what it would do to my health.”

The early years of parenthood were testing. “I’ve got so many weird, mixed feelings about it because it was the happiest time of my life yet there were times I was getting the depression back,” says Haig. “I don’t think it was anything other than sleep deprivation. It has taken me a long time to realise how important sleep is and if you’re having children, you’re never going to sleep the way you once did.”

But Haig wasn’t only concerned for himself. His mother had suffered postnatal depression and his great grandmother had taken her own life. According to research, if a biological parent has the illness, you have a 40% chance of developing it yourself. “You worry about the baton you’re passing on,” he says.

Meanwhile, mental illness in young people is on the rise. This year, NHS figures showed the number of children being treated for mental health problems was the highest it’s ever been, and a third higher than it was just two years ago.

“Just from people I know – relatives, friends – we’re hearing of panic attacks under the age of 10, school pressure, worries about what they look like at a far too early age,” he says. “There can be no denying we’re facing a crisis.”

Yet in some ways Haig could be better equipped than many to steer his children safely through. His recovery involved identifying aspects of his own youth that left him vulnerable. As an anxious boy and an awkward, “non-sporty” teen, Haig never felt he fitted in.

“I was middle-class – the son of a teacher and an architect – living in a working-class town,” says Haig, who has a younger sister. His adolescence was an exercise in trying to belong – drinking, taking drugs, but rarely at ease. Without a strong, authentic self to hold him up, Haig wonders if his breakdown was a kind of disintegration of so many failed, half versions of himself that saw him trying to be someone he wasn’t.

Terrible things make the good ones shine brighter

Haig sees aspects of himself in his son, Lucas. “My daughter is naturally more open and confident,” he says. “My son is more introverted.” Like his dad, Lucas isn’t sporty – but he has already written seven books, all over 10,000 words! “He’s basically imitating me. That’s why I have to be careful. But he’s having a very different childhood. My son’s much more self-assured than I was,” he continues. “If his friends are round and something happens that he doesn’t like, he’ll say it. He doesn’t do things he doesn’t want to do. He’s got more resilience.”

Being true to yourself and understanding there’s no single way for a girl or boy to be is one message Haig is careful to cultivate. He also encourages healthy habits. “I try to give some punctuation to their days, like going outside and walking the dog, where they slow down and disconnect.” The draw of technology is a challenge. “My son is into any button he can press,” says Haig. “You don’t want to make it a forbidden fruit. The big problem isn’t so much controlling the children’s usage, it’s about how much I’m using it in front of them. I’m addicted. This generation of children won’t say, ‘My parents were never there.’ They’ll say, ‘My parents were in the same room – but they weren’t there.’ I don’t have the answer. I just feel massive guilt!”

The most precious lesson, however, Haig wants to pass down is that life will throw curveballs – as it did to him and still does – but you can survive and thrive. “If Lucas or Pearl ever felt like I did when I was 24, they would know what it was, that they weren’t alone and that I’d survived it,” he says. “The precedent isn’t just getting ill, it’s also recovery.”

At the heart of Reasons to Stay Alive is the message that the storms pass. In the grip of his breakdown, Haig saw no hope and no future. The illness “lied”, he says in the book. Not only was there a future, what lay ahead was better than the life he’d had before. He’d married the woman he loved, watched his children being born, become a writer. Haig now thanks the illness for “waking him up” and helping him cherish the good times. “The person I became as a result is someone I wouldn’t have become without it.”

Haig’s newest book delivers the same message, only this time to children. A “truth pixie” tells a worried child that some of her worst fears will be realised – but there’s also joy ahead. “You don’t need to tell children that everything is going to be perfect because if they’re dependent on ‘perfect’, it will be very stressful,” says Haig. “Life will have some terrible things in it – but those terrible things will make the good things shine brighter. It’s a hard lesson at any age. But if you’re going to have that lesson, be told it by a pixie!”

The Truth Pixie is published by Canongate at £9.99. To buy a copy for £6.99, visit guardianbookshop.com.

In the UK the Samaritans can be contacted at any time on 116 123. In the US, the National Suicide Prevention Lifeline is on 1-800-273-8255. In Australia, the crisis support service Lifeline is on 13 11 14. Other international suicide helplines can be found at befrienders.org.