A year ago, I was struggling with a major episode of anxiety and depression. I’ve dealt with both my whole my life, and I’ve used various methods, some healthier than others, to cope. Last year, however, when my despair came seemingly out of nowhere, I felt like I had drained all my coping skills. What could I possibly do to help this time?

I felt on edge. Sitting down to focus on anything was impossible. I couldn’t sleep, but being awake was no piece of cake either.

Then one day I was in a craft supply store looking for a hot glue gun. I don’t remember why. As I passed by the aisle filled with yarn, suddenly a crazy idea came over me: I was going to knit a blanket. I’d never knit anything before. At the time I didn’t know anyone, besides my mother-in-law in Washington state, who knit. But somehow I knew this blanket would be my salvation.

When the kids got home from school that day, instead of finding me obsessively scrubbing the bathroom floor or crying in my robe, I was sitting on the couch, tangled in yarn. It looked like a crime scene. I had knit the button hole of my robe right into the beginning of that blanket. Balls of yarn were strewn across the floor, and I was holding a knitting needle between my front teeth.

“What is this?” the kids said. “What has happened?”

“I’m making a blanket,” I said.

They didn’t ask anymore questions.

That first project was a disaster. I was basically just tying knots in the yarn and calling it “knitting.” The finished piece, if you could call it that, looked like something our hunting dog had chewed in the backyard.

But I didn’t give up. There was something soothing about using my hands to create rows, right to left, and left to right. Anxiety and depression were virtually squeezed out of my thoughts: There was no room left for them.

Now my husband, although grateful for my newfound calm, wondered if I could get the same effect by doing something that, you know, I get paid for — like writing.

“You use both hands and your mind for that,” he reasoned. “Your hands even go back and forth on the keyboard.”

Writing is cathartic, yes, but it’s also hard work and requires a tremendous amount of creative pressure. I pull up a blank page, and I alone have to fill it with my own thoughts and ideas. I always feel better once I’ve done it, and writing is my true outlet, but to say that it doesn’t involve some psychological pressure would be inaccurate.

Knitting requires nothing creative from me. Someone else — a more creative, experienced knitter — has already done all the work. They wrote the pattern and even figured out exactly what yarn and needles I need. I’m just following orders, yet I’m still creating something.

So I was writing in the mornings and knitting in the afternoons. I had moved on from knitting my robe into the blanket, and I was making baby hats that looked like pumpkins, or, for my son, a hat that looks like a fish swallowing his head. I tried to knit things for my older boys, but they weren’t interested in a hat with bunny ears or a homemade sweater. Nevermind. Every time I learned of a baby being born, I made something for him or her.

And sure enough, all that knitting was helping my anxiety — and my writing. I always said my best writing ideas came when I was driving. Now they were coming while I was in the Zen-like state of knitting.

Science backs this up. The repetitive motion of knitting, which resembles soothing motions like rocking, has been shown to do everything from lower blood pressure, ease anxiety and help ward off memory loss. And for creative types, there is the added bonus of having something to show at the end. In a world full of ephemeral texts and emails, a hand-knit scarf can be held, felt and given.

Popular anecdote backs up the connection between knitting and writing, too. Ann Hood’s book “Knitting Yarns: Writers on Knitting” includes essays from 27 popular writers, such as Elizabeth Berg, Barbara Kingsolver and Anita Shreve who have experienced the knitting-writing connection.

It didn’t take long for me to become a knitting junkie. I was hanging out at knitting stores, making friends with people who understood increases and decreases, and I was knitting hats for anything that moved.

And each time I gave one of my hand-knit items as a gift, it came with the same disclaimer: I’ve knit all my anxiety into every last one of those stitches.

The receiver would laugh at my joke. But then we’d both smile. Because we knew that in order to hold together a sweater of twisted, knotted yarns, such are my amateur creations, the secret ingredient has to be something like love.

Maine author and columnist Sarah Smiley’s writing is syndicated weekly to publications across the country. She may be reached at Facebook.com/Sarah.is.Smiley.