As he sets out to spill his secrets in an online masterclass, Brown talks about bad reviews, his habit of hanging upside down and the challenge of writing fiction in the age of Trump

The piano music is insistent, melodramatic. The scene begins under a vaulted ceiling and medieval candelabra reminiscent of the Great Hall in Game of Thrones. The camera pans across a vintage typewriter, intricately sculpted animals, antique bowl, statuette of a monk and relief carvings of knights. It roves around a dimly lit, dark wood library. Suddenly, unexpectedly, a bookshelf swivels on its axis to reveal a secret passage.

Out steps the master of the page turner in blue shirt and jeans, his sleeves rolled up. He settles into a chair, leans against a red cushion, crosses his legs and smiles. A screen caption says: “Dan Brown Teaches Writing Thrillers.” Brown, who has shifted 250m copies of his novels and seen them translated into 56 languages, is the latest big name to join MasterClass, the online celebrity tutorial company (he is donating his fee to charity).

Despite the distinctly old-fashioned format – middle-aged white man dispensing wisdom direct to camera – this is Brown’s love letter to the creative process. The 54-year-old can’t tell you what idea to have, he says, but hopes to provide a roadmap on how to turn it into a story. His class includes chapters on finding that idea, choosing a location, creating heroes and villains, doing research (but not so much that it’s an excuse to procrastinate), creating suspense, writing dialogue and editing and rewriting.

The good news, Brown assures writers staring at a blank page, is that your idea does not have to be startlingly original. Ian Fleming’s James Bond, for example, always defuses the bomb and gets the girl. The key question is how he does it. “Every single idea has been done over and over and over,” Brown explains in the film. “You don’t need a big idea. You need big hows.”

Like parts of a car engine, the key elements of a thriller include a hero, a goal, obstacles that seem to make it impossible and, of course, a moment when the hero conquers the villain. Don’t get overcomplicated, Brown urges. “Build the foundation of your novel with a single brick: make it simple, make it easy to follow. Will Robert Langdon find the virus and save the world? Will Ahab catch the whale? Will the Jackal shoot his target?”

Among his first lessons are the three Cs: the contract, the clock, the crucible. “These are the elements that not just thrillers have but all stories have,” he explains at his publisher’s offices in New York. The contract is the promises made to the reader that have to be kept, so earn readers’ trust.

“The idea of a ticking clock: you go back to even something as gentle as The Bridges of Madison County. Her husband’s coming back in a few days and these two people have got to figure out if they’re going to be together. If they met in a town and there’s no husband coming back, and there’s no ticking clock, it’s not an interesting book.”

And the crucible? “That’s one of my favourites: this idea of constraining your characters and forcing them to act. If you look at the end of Jaws, you’ve got these people sinking on a boat and a shark’s coming toward them. The ocean’s their crucible: they can’t go anywhere, they have to deal with the problem. If they had a perfectly healthy boat and some big engines, they could just outrun the shark and the book’s over. But they’ve got the crucible.”

Facebook Twitter Pinterest Tom Hanks as Robert Langdon in Angels & Demons. Photograph: Zade Rosenthal

Teaching is in the Brown DNA. His parents were both in education: his father even went to the White House to pick up an award from George HW Bush. Teaching was one of Brown’s first jobs; he still looks the part in blue jacket, sweater and open-collared shirt. Writing fiction was a hobby and a hinterland.

He found that the classic lessons for budding authors – write with passion, keep your focus, show don’t tell – are all true but not especially helpful. A teacher told him: “Write what you know” when he was 16 and didn’t know much. So he came up with a solution: “Write what I want to know. I wrote a book called Deception Point about glaciology and Nasa. I didn’t know anything. I took a year and educated myself, which was part of the fun.”

His early books made little impact and he began to question whether he could make a career of it. But then he came up with The Da Vinci Code – in which Harvard code specialist Robert Langdon discovers a series of cryptic clues in the works of Leonardo – and thought it the exact book he would like to read; millions agreed. Published in 2003, it became one of the bestselling novels of all time and was turned into a film directed by Ron Howard and starring Tom Hanks.

Does success like that become a burden? “I definitely had a number of weeks when I became self-aware. You type a sentence and say: ‘Wait a minute, how many millions of people are going to read that?’ And you read it again and see the word ‘there’. You suddenly say: ‘I didn’t even spell that right.’ You become the guy trying to swing the baseball bat who’s thinking of how to move the muscles and you’re crippled.

“I think that’s very common across many disciplines when you have success. I was fortunate pretty quickly to be able to say: ‘Wait a minute, you just need to do what you did the last four times, which is to write the book that you’d want to read and if you read this paragraph and you’d like to read it, you’re done.’ I was able to move on from that and write The Lost Symbol, which I was thrilled with and did great and a lot of people like it better than Da Vinci Code.”

Brown cites Joseph Campbell as a literary influence and adores Shakespeare’s Much Ado About Nothing. He hopes his class will help not only aspiring thriller writers but all storytellers. That is likely to produce a sceptical scoff from literary critics who regard him as a low-to-middle-brow merchant of the ludicrous. In a Guardian review, Mark Lawson described The Da Vinci Code as “450 pages of irritatingly gripping tosh” that is “preposterous and sloppy” but succeeds because it “offers terrified and vengeful Americans a hidden pattern in the world’s confusions”.

Brown is philosophical about the backlash. “Of course we’re all supposed to pretend we don’t read the reviews, or at least we don’t care. The reality is you want everybody to love what you do and, when it doesn’t happen, when you read a review – and certainly, especially, in your country there have been some pretty vicious reviews – you have to just sort of laugh and say well, OK, clearly this person doesn’t share my taste. You get past it at some point and you have to put the blinders on.

“I got great advice early on: if you read your reviews, the good ones will make you lazy, the bad ones will make you insecure, so just do what you do, you’ve proven that you know what you’re doing. There’s a portion of the population who will wait for my novels and say: ‘Oh my god, I love that.’ And there’s a portion that will just go: ‘Oh my god, not again, not that guy, I hate that guy.’ That’s OK, you write for the people who love you and the great thing about books is if you don’t like mine, there’s a million others published every year and you can find one you do like.”

It was not just its literary merits that caused controversy. Some complained that The Da Vinci Code was offensive to Christianity because of its depiction of Jesus marrying Mary Magdalene and fathering a child. It is another example of Brown’s tendency to run towards, rather than away from, the big questions. “The wonderful thing about controversy is that it creates dialogue and, as writers, I think that’s our job to say: ‘Here’s one way you can think about this, but here’s the other way you can think about it.’

“In the class I just try to say: ‘Look, you’ve got to write something that you’re passionate about, that really excites you.’ For me, personally, it’s good people doing the wrong thing for the right reasons, or bad people doing good things for the wrong reason. I like that moral grey area.”

Last year Brown published his eighth novel, Origin, about artificial intelligence. Does he think it is going to take over the world? “The answer’s yes and that’s something that scientists agree on. It is going to be enormously influential and where they disagree is whether or not we can control it, whether it will be used for good or evil, whether it is going to destroy us. I tend to be an optimist and the end of the novel is very optimistic about where we’re going with technology.”

Brown is often accused of being anti-religion, but prefers to describe himself as “definitely agnostic”. As he explains: “I don’t think I know enough to be an atheist. If you said: ‘Right now and you can’t get this wrong: is there a God?’, I’d say: ‘I don’t think so.’ But I’m also wide open to being proved wrong.

“There are enormous parts of the human experience and science that make no logical sense, no rational sense, and certainly imply that something else is going on. I would not be surprised to find that there is some good big thing. I would be very surprised to find that he’s a white male with a long beard who had a son named Jesus. The religions of the world have come up with some pretty interesting tales about where we came from and why we’re here. I don’t think any of them are true, but I’m open.

“People have asked me: ‘How does technology affect religion?’ I say enormously because when I was a little kid and they said this is what happened with Adam and Eve, you said OK. Now kids go, actually 97% of the world said that’s ridiculous. So the church has this challenge in getting its message out because there’s so much counter information that is accessible to young people.”

Facebook Twitter Pinterest Dan Brown filming his masterclass at his home in New Hampshire. Photograph: Drew Gurian

But technology has its downsides and Brown has had to become an expert in blocking it out, starting his day at 4am. “I try to get from the sleep state – the dream state – to my desk as fast as possible,” he explains. “The great thing about writing at 4am is really there’s nobody else writing you emails.

“I’ll sprint to the kitchen, grab a spinach smoothie and some coffee and get straight to my office and I’ll work for between six to nine hours depending on how much energy I have. A lot of it is editing what I wrote the day before, to see if it’s holding up. I might be outlining, I might be writing. It just sort of depends what that day requires.”

Brown uses an app that makes his computer screen go dark for one minute an hour, compelling him to take a break and do push-ups and sit-ups or hang upside-down, although he has had to give up wearing gravity boots. “My wife was very concerned that I would pull myself up into these gravity boots and not have the strength some day to get back and I’d just be hanging there for ever. So I now use an inversion table. I just find that it refreshes me so well: enormous amount of blood flow to the brain, spread your spine.”

Does he ever suffer from writer’s block? “The cure to writer’s block is to write. Write something bad that nobody will ever see. But that process will show you the way back to what’s good. I throw out about 10 pages for every one that I keep.”

What constitutes good might be less certain than ever. In the era when Donald Trump is the president of the United States, it is hard for fiction to keep up with reality. Trump is arguably more outlandish than any cartoon villain and it is not only Brown’s plots that are being called preposterous.

He reflects: “I was at the Frankfurt book fair and somebody asked me if I’d thought about writing about Trump. I said: ‘If I wrote The Trump Code, nobody would believe it.’ Reality has surpassed fiction. In my masterclass, if I said: ‘Hey, you know what, how’s this idea for a character?’, we would have to cut it out because it would make no sense. You would say: ‘Nobody acts like that, certainly nobody who could reach this station.’”

He insists he is not a political person but admits he is “pretty horrified” by the 45th president. He adds: “I think he’s a profound threat – less of a threat to the republic than he is to the honour of the presidency. The republic will survive: there are enough smart, levelheaded people on both sides of the aisle to keep the ship afloat. But he’s certainly damaged the reputation of the presidency and, to some degree, the country.”

Given Brown’s vast following, I suggest, he must have Trump voters among his readers? “I do,” he says. “It’s fascinating. You realise you really can’t be political. For me to say I’m not a fan of Trump to you publicly is probably professionally not that smart. But at some point you just say, ‘Well, that’s how I feel.’”

Dan Brown’s class is available at www.masterclass.com/DBr. Enrolment for the class is £85/$90 for lifetime access, or you can pay £170/$180 for a year’s all-access pass, which grants unlimited access to all new and existing classes.