I had a few brief spells in solitary, each time becoming a bit unglued. Of course, I understand that it’s my fault I ended up in prison in the first place. And I understand that right now this enforced isolation is necessary to save people’s lives.

But in the moment, that doesn’t always make it easier. I find myself doing all the things I did in prison, like rocking back and forth when I go to sleep. Once again, I’m stocking up on toilet paper, instant coffee and canned peas — the commissary items I relied on to make it through. I’m running. I’m marking off days on a calendar. I’m doing crossword puzzles, looking for a place in the world where I know the answers.

Last week, I texted my friend Stacy, whom I met in late 2011 in a prison in upstate New York. Stacy did a lot of time in solitary for nonviolent rules violations.

The thought of lockdown incites panic in her. For the first time ever, she told me, she’d been prescribed Valium to handle the constant anxiety as she isolated herself inside her New York City apartment — “that caged animal feeling.”

But some people who have been inside think that prison trained us perfectly for long-term lockdown, even unrest and chaos. As little as incarceration did to prepare us to thrive in the free world when the sun shines, it did much to prepare us to survive when the world feels like it’s falling apart.

“Think about the dynamics of prison,” my friend Paradise told me, as we messaged late at night. “It forces you to constantly conserve. Be aware. Ration.

“Also creativity,” she said. “It makes you use what you have to get to what you need.”

She’s not wrong. Behind bars, we learned how to squirrel away necessities we couldn’t get enough of, devising homemade tampons and concocting makeup out of FireBall candies and lip gloss. We figured out how to cook jailhouse Mexican food out of ramen and Doritos, and how to make tattoo guns out of gel pens, ashes and sharpened metal.