I was accused of stealing when I was seven years old. True story. A bottle of glue went missing from our class cupboard and a small, skinny girl called Joyce, whom I hardly ever spoke to, stood up and, in front of the entire second standard, calmly pointed her finger at me and told the teacher, “She stole it.”

Joyce was lying, but it didn't matter: the words branding me a thief had already been said. To make matters worse, the teacher didn't admonish my classmate. When I protested, she asked me to be quiet and sit back down. Worse, she ordered me to bring the bottle that I had (supposedly) taken back the next day.

I have forgotten everything – the name of my teacher, the faces of my classmates – but all these years later, I can still feel the stinging shame and rage at the unfairness of it all. I was in childhood hell, doubly accused, betrayed by a peer and a trusted adult.

Still, I did nothing. Like most children, I had few choices. The world was inherently unfair and adults were the boss at all times. Plus I was a girl, taught not to talk too loud, to respect my elders, to sit with my knees decorously touching. This was real life, where sometimes when you're in trouble, no one comes to rescue you.

Fortunately, for all of us there is fiction. Fiction lets kids imagine alternative scenarios in which they are in charge of how the world treats them. In fiction, when kids get into trouble, they can be heroes. Or sheroes.

The writer Charles Baxter famously said: “Say what you want about it, Hell is story-friendly…” Not only is trouble useful to get the engine of the story revved up, but it is also absolutely necessary to transform ordinary little girls into heroes.

Trouble lets kids see a girl try.

A pressing dilemma, a terrible problem, helps to push the protagonist to take the reins of the story into her hands. She’s forced to accept her predicament and try to solve her problems any way she can. She may fail at first, brought down by a smarter opponent or her own scared heart. But she will be compelled to set out on her quest or adventure, make friends and fight enemies in order to win the prize – until she returns, transformed into someone greater than who she was when she started out.

The reader can identify with her quest, feel sympathy for her, root for her and cheer her on. The act of her trying –­ butting her head against the wall, finding ways to deal with the mean teacher or fight the belittling voices in her own head – will make the reader's heart race, feel pity or stress, get them intensely involved in her story. In the alchemical transference that fiction achieves, the reader identifies with her and desperately wants her to keep trying.

Trouble lets kids see a girl make her own choices.

The heroine needs to have the story revolve around her. Being in trouble keeps her at the centre of her own story, where readers can cheer her on as she makes her own choices, which in turn lead her to take action.

Katniss Everdeen in The Hunger Games makes a choice to save her younger sister. This spontaneous decision leads her to becoming the Tribute of her district and compete in the Hunger Games. The choices a character-who-will-be-hero makes lets readers see how the girl hero owns her actions and her results. No one tells Katniss what to do – her resolve to save her sister is completely her own.

In Maya Saves the Day, my first children's book, Maya decides to go up to the loudspeaker in a mall and take the actions that will eventually lead to her finding her lost parents. It is a decision that has the potential to get Maya into even more trouble, but we also see her make that choice, take action and own the consequences. When the heroine owns her choices, she also owns her successes – and her failures.

Trouble gives kids an opportunity to witness a girl being challenged.

Trouble is what tests the heroine's resolve, sending her teetering to the edge of defeat. To become a true hero she has to be pushed to her limits. She has to face up to her fears.

In Roald Dahl's famous book, the eponymous Matilda, the five-year-old protagonist has to fight her fear of Miss Trenchbull, the principal who terrorises the children in the school. In order to overcome the challenge, Matilda has to reach deep into herself and find the psychological resources, the physical bravery, the wisdom, the integrity and the street smarts to grow into her heroic self and defeat Miss Trenchbull.

After I left elementary school, I never saw Joyce again. I'm grateful to her, though because she gave me a story. A story that has a missing bottle of glue and an accuser who gets a little girl into big trouble. I did nothing all those years ago, but in the book I eventually wrote, the little girl at the centre of it eventually discovers how to become a hero.

Meera Nair is the author of Video and the children's books Maya Saves The Day and Maya In a Mess. She lives in New York, USA, and teaches at NYU. She tweets here.