I highly recommend McKinley Valentine's email newsletter, The Whippet. In each issue she presents interesting ideas, art, videos, and articles.
Here's an item from the latest issue (#85):
How to survive solitary confinement
I like to read things like this, keep it in my pocket, so I worry less about what if it happens.
The recommendation is more or less -- you'll go crazy anyway, so go crazy with intention, to protect your brain.
The human brain does very badly in social isolation - we're not built for it, and people start hallucinating and dissociating very quickly when it's complete. It's actual torture, but people don't expect it to be because it sounds so low-key.
So the people in this article - both people who've survived solitary, and psychologists - suggest using a lot of visualisation. Imagine yourself in a much bigger space than you are, get to know it. Have a "workspace" where you train, maybe practice a sport in your mind. Every day, regularly, like you were outside and had a proper life. Imagine meeting a friend and having conversations with them.
Part of what makes you go crazy in isolation is the lack of external cues and structures, so it has to be structured visualisations, not just panicked uncontrolled daydreaming.
From someone who survived 7 years in almost total solitary confinement (again, this is torture, it is amazing he came out of it relatively okay):
"He he used to kill time for hours working out detailed visualizations of himself in a vivid alternate reality, where he could inhabit open spaces and converse with people.
“I might imagine myself at a park and come upon a person sitting on a bench,” he says. “I would ask if she or he minded if I sat down. I’d say something like, ‘Great weather today.’ The other person would respond something like, ‘It is indeed. I hope it continues until the [football game].’ ‘I know what you mean. In another couple of weeks it’s going to be cold as a witch’s tit in Wisconsin.’ As we conversed, I would watch joggers, bicyclists, and skateboarders pass by. The conversation might go on for half an hour or so. When I opened my eyes and stood, I would feel refreshed and even invigorated.”
There you go, now you're prepared.