Tomi Adeyemi attended Harvard intending to become a doctor, did finance internships in college, and had a manuscript rejected by 63 literary agents—all before receiving one of the largest-ever deals for a YA debut when she was just 23. That book was the first in her New York Times–bestselling Legacy of Orisha series, in which protagonist Zélie and a small band of companions fight to restore magic, order, and peace to their land and battle enemies from within. (The book is currently being adapted for a feature film to be directed by Gina Prince-Bythewood.) In the long-awaited finale to the trilogy, Children of Anguish and Anarchy (Henry Holt, June 25), Zélie and her friends confront intruders from outside Orisha who threaten the land anew. Adeyemi, now 30, spoke with Kirkus by Zoom from her home in New York City; the following interview has been edited for length and clarity.

You studied in Brazil on a college grant. How did your studies influence the trilogy?

A really influential part of my education [was] discovering African American literature. Reading The Souls of Black Folk by W.E.B. Du Bois was such an intense and transformative experience for me. Reading about what it felt like to be Black in America right after Emancipation, to read something that was written [more than a century] ago and feel as if it was written for today, taught me how powerful literature is, where we explore our souls and our spirit and our consciousness.

I knew that Brazil and America were very interesting parallels, because I think Brazil brought over 10 times as many slaves during the Middle Passage as America did, but then both countries treated identity differently. In America, we had the “one drop” rule—if you had any Black ancestry, you were considered Black. In Brazil, it wasn’t as binary. Then, while in Brazil, I stumbled upon these ceramic tiles [of West African deities]. My mind exploded when I saw them because I’d never even imagined that there were African gods and goddesses. It was earth shattering and soul healing . The map of Orisha exploded into three dimensions in my head. I saw the world: I saw the temples, I saw the lions, I knew it was epic. I marinated on these ideas.

And then about eight months later, I discovered who the characters were because I was inspired by another picture of this divine Black space girl, and I thought, What if a fisherman goes to trade a fish one day and she runs into a princess, and the princess says, “You have to get me out of here”? It was like I’d captured the world of the ceramics and then added everything that was in my heart—my version of The Souls of Black Folk during that time.

Any advice for someone interested in writing fantasy with a social message but that doesn’t veer into the overly didactic, something where the art shines through?

In one of the seminars I teach, I describe this [idea] as “finding your beating heart.” I think the best books have a beating heart. That beating heart is whatever’s in your heart at the time. For me it was being torn up about Tamir Rice being 12 years old and playing in a park and getting shot. It was being torn up about Philando Castile being gunned down in front of his girlfriend and her 4-year-old daughter. Being torn up about Dylann Roof walking into a Bible study in Charleston, South Carolina, and murdering nine Black parishioners who were just there to worship. It was about tragedy after tragedy after tragedy.

At the time I described [these experiences] as emotional PTSD, because I was having panic attacks. My mother tells me I called her sobbing almost every night. So I had to express that to get it out of me. On the one hand, you have the plot, the story, the adventure, which is a girl fighting to bring magic back to her people in this fantastical West African world. On the other hand, you see what I had to get out of my soul, right?

I think the best stories have both. You’ll have an adventure as the story’s objective. Something almost mechanical—a protagonist, a goal, the pursuit of that goal, the obstacles that get in the way. But the beating heart is whatever’s in your heart right now.

How do you discover what moves you so much that you have to get it onto the page?

There’s so much happening in our world. There’s so much chaos, instability, suffering, and pain. Is there something that’s making your heart bleed or making you cry at the quietest moments of the night? That’s what you need to find a way to express, to let your heart bleed over the story that you already have in place. I can only talk for myself, but I find that to be not only a therapeutic and healing process, but what it does to the actual story is take it from just “She rode a lion and slayed this boy” to “She defiantly crawled to the sunstone and she held it up high.” That’s a metaphor for what’s going on in your heart.

Why fantasy, as opposed to another genre, to get your stories on the page?

If you’d asked me this years ago, I’d have said, “Who wants to live in this world?” I wrote fantasy for so long, since I was 10, because I couldn’t really cope with being in this world. I not only needed these fantastical worlds to escape to, but I needed them to feel safe. I needed to feel like there was a way to fight for a utopia because there was so much chaos around me.

Will you continue writing fantasy?

The younger me needed fantasy. But last week I finished the first draft of my fourth novel, and it doesn’t take place in the world of Children of Blood and Bone. It takes place in this world.

Nowadays I see more pain and suffering than I can imagine or process; it’s everywhere. But I also know how powerful our fights can be, whether that’s protesting, whether that’s writing a book, whether that’s just holding hands with someone across a book table. I’m so overjoyed with the endless ripples.

Yes, there’ve been awards. Yes, I got to hug Whoopi Goldberg at the Met Gala. That was awesome. So yes, there’ve been very sparkly things, and things that make the Instagram feed. But then I think of the number of times I’ve gotten to hold someone’s hands, hear their story, hear how [something] has healed them. The things that you can’t capture in a little picture and put a cute little caption on—those real, human things.

Sure, when you’re only getting humanity filtered to you through the news or through your social media algorithms, you’ll be getting a pretty abysmal view of the world. But if you’re really out there and getting to talk to and connect with people the way these books have allowed me to, it’s different. I’ve met too many beautiful hearts to be pessimistic about the state of our world.

Christine Gross-Loh is the author of Parenting Without Borders and The Path.