The first time my daughter knotted her hair, she was just under 3 years old. I’m not talking about a little rat’s nest from a restless night sleep. I’m not talking about the kind of tease created by rubbing a hairbrush backward over your hair. I’m not even talking about gum stuck in her hair. I’m talking about steroid-infused, nuclear monster-knots that compounded on top of one another like warts and took anywhere from 10 minutes to an hour each to untangle.

My morning routine became coffee, breakfast and meticulous unknotting, followed by sobbing in the bathroom. Then the knots started appearing more frequently. Every time she left the room, she would return with a new, more sophisticated knot. By her third birthday, she would have put sailors and Boy Scouts to shame with the intricacy of the knots, which were so close and tight to her scalp that they killed the follicles. And for every chunk of her blond curls that pulled away in my hands, I wanted to tear out my own hair, too.

I started developing carpal tunnel from picking at knots, and I’d lecture her as I untangled. I’d beg her to stop, bribe her, encourage her, offer alternative ways to busy her fingers instead.

I tried everything I could think of, including soaking her hair in coconut oil every night before bed. But nothing worked, and the oil just meant I had to throw away her sheets in addition to clumps of her baby hair. The more anxious I became, the more she knotted her hair. Eventually she’d worn away a bald patch the size of the bottom of a soda can on the side of her head. I started to dread waking her each morning because we both knew there would be a new knot to fight over, and I couldn’t bear the look of shame in her eyes when she had to show me.

Did I love her any less? Of course not.

But I felt like I was failing as a parent. I started picturing her at her senior prom or on her wedding day with a comb-over. As much as it broke my heart to see my daughter suffering — and witness the physical evidence of that pain — it was worse to know that my anxiety about her damaging her hair was breaking her heart, too. She began covering her hair with her hand when I walked into a room. She knew I’d be disappointed that she’d made another knot.

Her stress was real, and she was managing it the best way she knew how, and I had become another obstruction along the way.

Eventually, I realized that she was suffering from anxiety that had begun even before the knotting. Most adults are familiar with the typical symptoms of anxiety: a racing heart, a tight chest, a rush of fight-or-flight adrenaline for no reason. But what I’d never understood before was that anxiety in children can manifest in unexpected ways. According to the Child Mind Institute, some kids with anxiety complain of stomachaches. Some have nightmares. Some get aggressive. And some develop nervous tics, such as thumb-sucking or hair-pulling.

Many healthy children play with, cut, or pull out their hair, which is why compulsive conditions such as trichotillomania — an impulse-control disorder characterized by picking or pulling out hair from the body — aren’t typically identified until adolescence or even adulthood. However, if a child shows significant anxiety and stress around the hair pulling, the condition can worsen without treatment or intervention.

Regardless of labels, my daughter was struggling, and I had let her down by placing more importance on her outward appearance than her mental well-being. Instead of making her feel safe, I’d shown her my frustration and anger at her inability to stop knotting. I’d introduced her developing brain to shame and insecurity, and I’d slowly plucked away at her trust for me and our relationship every bit as much as she’d plucked out her hair.

So we went together to the barber shop on her third birthday, and we asked them to buzz off the soft blond locks I’d been picturing in my mind since the sonogram technician told me she would be a girl, and which I’d been running my fingers through since the day she was born. As it lay in limp strands on the tile floor, I picked up a single lock to save in an envelope and watched them sweep up the rest without a word. I made a silent promise to myself and to my daughter that I’d never again let her see me upset about something as unimportant as hair.

I wanted to send my daughter a message of acceptance and self-love, rather than embarrassment for being less than I expected. We dyed what was left of her buzzed hair pink and even shaved off the hair of one of her dolls at the same time so they would match. We talked about how exciting it was that she was creating her own style, and how proud I was that we were doing something positive for her.

Over the next few months, I started calling her mini-Pink. Short hair became her signature look: something she was (and still is) proud of every day. The shame she’d felt for knotting her hair was gone. Both adults living with fully realized trichotillomania and practitioners who treat repetitive behavioral disorders agree that the best way to approach a child with budding compulsive anxiety is with acceptance and gentle removal of triggers. I just added a little bit of pink hair dye.

Before I had kids, if someone had asked me what images appeared in my mind when I pictured being a mother, I would have answered three things: Saturday morning sports practices, packing school lunches, and brushing and styling my daughter’s ratty hair. Each one seemed to be another piece of the larger puzzle of raising happy, healthy children.

However, parenting isn’t a solvable puzzle. The pieces are constantly moving, changing and appearing or disappearing. Or worse, you never had all the pieces to begin with. Parenting is more like an enchanted labyrinth than a static jigsaw. The moments that truly matter — the ones that define me as a mother — are not visible on the surface. And they definitely can’t be taken away by a sports injury, a hot lunch or a shaved head.

Shaving my daughter’s head was one of the hardest things I’ve had to do as a parent. I excused myself a few times during the process to gather my emotions and make sure she never saw me anxious or upset again about her hair pulling. But it’s also probably the best thing I ever did for our relationship. No more hair. No more knots. No more fighting.

And just as quickly as it had started, my daughter stopped pulling out her hair. On her own terms. Now, almost two years later, I am almost able to braid her hair again. And I couldn’t be prouder of her, not because her hair is long, but because she overcame her own anxiety.

Hair grows back; trust is harder to cultivate.

Mary Widdicks is a former cognitive psychologist, freelance writer and author of the novel “A Mutual Addiction.” Read more at marywiddicks.com. You can find her on Twitter @MaryWiddicks.

Like On Parenting on Facebook for more essays, news and updates and sign up here for our newsletter.

More reading: