When I started writing my second novel early last year, I made a gigantic mistake. At the time, I didn’t see it as a gigantic mistake; I saw it as a smart and clever editorial decision. I was both wrong and right about that. Anyway, I wouldn’t realize the trouble I’d gotten myself into until this spring when the mistake led to a profound and miserable bout of writer’s block. Spring — the season of fecundity and rebirth. How ironic is that?

My second novel, Days of Wonder, is about a theater director named Tom and his 15-year-old daughter, Hannah, who has a life-threatening heart condition. They live in a small town in the southwest of England, surrounded by eccentric friends who care deeply about them. Hannah has grown up around fairy tales, comic books, and theatrical productions; her life has been happy and sort of magical — but now terrible things are coming for her. I made the decision to write the novel in the first person, alternating between the viewpoints of Tom and Hannah. This, I thought, would let me show how the two of them viewed their relationship and their challenges differently. The reader would pick up on all those little contradictions in perspective and interpretation that happen in relationships. How clever!

Then I realized something: I am a 46-year-old man, and I had committed to writing at least 65,000 words of this novel in the voice of a teenage girl.

What. The. Fuck.

It didn’t help that, at the time, there was a lot of cynicism going around about the status and future of the novel itself as a medium — and it was coming from men like me. The ridiculously clever writer Will Self had just given an interview to the Guardian in which he declared that the novel was dying. The comment provoked a lot of anger and resentment — here was another white, middle-aged, male cultural gatekeeper slamming the door shut behind him because maybe he wasn’t selling as many books these days. I felt embarrassed and complicit because I’m a white middle-aged male. I’d written about 20,000 words of the novel at this point. But then I stopped. I just stopped. How could I write Hannah now? I felt embarrassed and tainted.

Some authors are really macho about writer’s block. They say it doesn’t exist, it’s a state of mind, it’s an excuse to procrastinate. I’ve heard authors say, “Oh, grow up! Plumbers don’t get plumber’s block,” which is so classist and problematic I don’t even know where to begin — also, until the day I can wander into a hardware store and buy a perfectly constructed sentence, it’s not even that useful as an analogy.

Instead of writing, I wasted a lot of time Googling literary greats who had also suffered writer’s block. Franz Kafka has a diary entry on January 20, 1915, that simply reads, “The end of writing. When will it take me up again?” Nine days later: “Again tried to write, virtually useless.” He goes on like this for weeks. It was very cathartic for me.

Eventually, I decided I had to do something more proactive. I closed my laptop and went off to read a book. If I’m writing as Hannah, I thought, I should read the kind of thing that she would read, so I bought a copy of Am I Normal Yet, a young adult novel by the British author Holly Bourne.

YA fiction is indivisible from activism.

It was an utter revelation. Am I Normal Yet is the story of Evie, an anxious teenager who has suffered anxiety and obsessive-compulsive disorder and is now starting at a new college, trying to reinvent her life and her sense of self. With a small group of friends, Evie sets up a feminist discussion group, which provides a framework for her recovery. It is funny, warm, devastating at times, but utterly unapologetically about the value of feminism. The voice, the sense of being that Bourne pours into this character, is incredible — there is a scene where Evie almost has sex for the first time, and the raw fear, the self-analysis, the feeling of being trapped in the moment, is so powerful. I went out and bought everything else Bourne had written.

As a 46-year-old man who grew up reading comics before transferring to the basics of the twentysomething male literary canon (“oh hi J.D. Salinger, hey Updike, hey Waugh, well hello Martin Amis, where have you been all my life?”), I’d never read YA fiction. To me, it meant fantasy novels for kids. It meant Harry Potter and Twilight. I’d managed to overlook one of the major areas of growth and excitement in the contemporary publishing industry.

I started reading YA voraciously. I read Nicola Yoon’s beautiful love story Everything, Everything. I read Jennifer Mathieu’s incendiary riot-grrl fable Moxie. I read Angie Thomas’ breathtaking The Hate U Give, which analyzes the police shooting of a black teenager with a seething fury. What I found was that the savage discourse that’s been raging across social media for the past five years—the giant battles between the progressive left and the alt-right, the defining themes of identity and society, feminism and gender, empathy and free speech — were being picked apart in YA novels like absolutely nowhere else, emancipated from traditional literary mores, hierarchies, and conventions.

Feminist critic and journalist Sarah Ditum has been reading YA and sharing it with her daughter for years. “It is voracious and omnivorous and unencumbered by a lot of the categorizations older audiences are bound for,” she told me. “Alex Wheatle is a black British author who started out with adult novels. I chaired an event for him last year, and he explained that the move to YA was because he and his agent were sick of him being pitched as the Black Author, treated essentially like a trophy, and having his books undersupported by marketing departments who saw ‘worthiness’ as the only salable angle.

“YA let [Wheatle] free from all of that, because it’s a totally different world. It’s not ‘prestigious,’ which means all those Booker-hunting prestige-hog white male writers tend to keep their noses out. Its readers want entertainment, storytelling, humor, plot, character — all the things that are seen as ‘commercial’ rather than ‘literary’ in adult books, and all the things that take a reader into new worlds of characters they might never have encountered before as a central consciousness.”

Ditum is well aware that the YA scene is not a utopia — it’s close-knit, and authors can be torn apart online if they fall short of perceived social justice standards. But that’s part of what makes it so vital and incendiary. This summer, I attended the Celsius 232 literary festival in Spain, where I met Margaret Stohl, a comic book writer and video game narrative designer. She co-wrote the bestselling Beautiful Creatures series of YA novels and organizes the two major YA literary festivals in the United States: YALLFest and YALLWest. In June, when news broke that the children of illegal immigrants were being kept in cages in Texas detention facilities, Stohl and her festival co-organizer Melissa de la Cruz created a protest campaign: “Kid Lit Says No Kids in Cages.”

“Basically our whole community got behind it,” Stohl says. “It took us one day to pull it all together. Tomi Adeyemi, Jenny Han, Angie Thomas — they all posted stuff. Young readers are watching, and they want and expect this. I’ve been to Manila, Budapest, Kuala Lumpur, Taiwan, Hong Kong, and it was really interesting to meet teenagers from around the world and see what they all have in common — which is that their lives are being destroyed by a lack of control and fear about the future.”

For Stohl, YA fiction is indivisible from activism — the two are linked by a readership, a community, that wants to be seen and empowered — and it is frustrated by and angry about the status quo. “Anyone who works with teenagers, anyone who works with the free expression of thoughts and ideas, anyone who cares about personal liberties…it’s been very difficult in the U.S.,” Stohl says. “We’ve ruined America for teenagers. But there’s a lot of faith among the teens we write for and know so well — they will not have it, and they’re very vocal about that. It’s the one sign of hope. Teenagers are better people than we are.”

“I’ve learned that if you’re silent, you’re part of the problem.”

One night during the festival, I went out for dinner with Margaret and the hugely successful Spanish YA author Javier Ruescas, who had just come out as gay and whose novels feature LGBT characters. He’d recently been in a battle with TROA, a major bookstore chain that, like a lot of bookshops and publishing houses in Spain, has strong links with the Catholic church. TROA had just taken his novels The Nonsense of Love, Show, and Live off store shelves because they portrayed gay characters. Ruescas took to Facebook and Twitter, reaching thousands of his young readers to tell them he was angry. He received an enormous amount of support. This is what I’ve seen with YA — the novels are part of something bigger: a demand for a voice, for a place at the table.

“Look, when my mother sees that big publishers like Planeta are now publishing books with LGBT characters, it means she’s not as worried about me anymore — she’s not as worried about how the world will treat me,” Ruescas says. “Shows like Sense8 connect with everyone. We have a show on Netflix called Merlí, which is a teenage drama about a high school — there was a whole story around a gay couple, and people are still talking about that show. That’s why art is so important. I’ve learned that if you’re silent, you’re part of the problem.”

Saturating myself in YA fiction — encountering new voices and new ways of thinking about narrative and character and about the fucking responsibility of writing stories — has changed a lot of my writing habits. I got a bit looser and braver. I rewrote all the sections with Hannah. I thought about the authors I’d met. I went out and spoke to a lot of teenagers, interviewing them in cafés and in their homes. Theirs is an alien world of endless Instagram streams and Snapchat stories, of social media judgment and analysis; their every moment captured, shared, and dissected; privacy is meaningless. I modeled Hannah on them to some degree — on their mix of optimism and vulnerability, on their openness, on the amount of emotional labor girlfriends do for boyfriends.

My book is set in 2005, on the precipice of the social media era of furious discourse and identity politics — I let it start dripping into the lives of the characters, just in a few little moments. I learned how to do that from YA. I learned that moments are super important; I learned (or maybe remembered) how it’s small gestures that matter when you’re a teenager, not epic events or long diatribes. There’s a beautiful scene in Lisa Williams’s book The Art of Being Normal, where a young character exploring her trans identity goes into the bathroom on a train and changes out of her boy clothes into her girl clothes, then puts on makeup. Before going out, she has this tiny moment of uncertainty — Do I look like a girl? Does my jawline look to broad? — and when she steps out, she bumps into an older man and apologizes. He says, “It’s alright, love,” using an affectionate term that a middle-aged British man would only use on a girl. It makes her day. It makes her life. And it’s so simple, so brief. My god, I learned so much from that.

I emailed Holly Bourne when I was writing this story and asked if she felt a responsibility to her readers when she wrote about feminism as an everyday thing for teenage girls. “I feel a huge responsibility,” she told me. “Giving a young person the right book at the right time can totally change their life. Stories can be so powerful and such a force for good, and teenagers are so open to challenging ideas, beliefs, social injustice. Nothing about them is set in stone—their brains are still forming, their identities still up for grabs.

“I use that responsibility to try and write books that will benefit their lives and help my readers feel more empowered. Feminism empowers everyone — both girls and boys. That’s why I write about it so explicitly.”

I tried my best with Hannah. I spoke to my female friends about her, got them to critique her every action, her every sentence. Men writing as women can be an utter disaster. But then I just thought this is a story I want to tell, and no one else can do it, and it might help someone, somewhere, somehow. And there was a little voice in my head — very quiet, very uncertain — that said, you know what? You’ve never really felt 100 percent straight or 100 percent male. Your role models as a teenager were Madonna and Sigourney Weaver. For once in your life, maybe just go with it?

Throughout all this, I learned three ways to beat writer’s block. One is to read outside of your comfort zone; to experience new voices and new ways of tackling big subjects, to take the time to breathe in fresh, exciting stories and methods. I also learned that if you’re stuck, it’s good to talk to the people you’re writing about. Get out there, sit down, and chat. It’s obvious maybe, but fiction writers can sometimes get trapped in a solipsistic headspace where anything that doesn’t come mainlined from their own imagination is somehow cheating.

It’s not. Life is out there, and we have to listen to it. We have to tell stories in the way that makes sense to us and to our characters, and we need to feel confident that traditional notions of form and function and plot and structure can be broken apart and rebuilt.

We writers need to able to look at ourselves and assess who we really are. Modern teenagers are great at that; they’re constantly dissecting themselves, they’re fluid, they’re brave. They have to be.

And so do we.

Update: This article previously incorrectly stated the year Franz Kafka wrote his diary entry. It was 1915.