Retired colonel Terry Virts spent over seven months in space, serving as a NASA astronaut, performing space walks and commanding the International Space Station.
The former U.S. Air Force pilot spoke to ABC News this week about his new book, "How to Astronaut: An Insider's Guide to Leaving Planet Earth," in which he details things like taking a shower in space, eating, sleeping and what happens if an astronaut gets stranded.
On ABC News' "Perspective" podcast, Virts told ABC's Cheri Preston that he dealt with a lot of isolation while traveling in space.
"We had a couple of cargo ships blow up and I was stuck in space," he said. "We didn't know when we were coming back. We were low on supplies. So it's really similar to what we're doing down here now... There is a chapter about how to survive isolation."
As a former fighter pilot and astronaut, Virts said he frequently had to confront the possibility that he could die instantly. By compartmentalizing the grim prospect of instant death, he was actually able to carry out his duties.
"If you thought about that for 200 days, you know, you'd go insane… You just have to figure out how to put it in a different compartment in your brain so it's not in the front," he said.
Virts believes the isolation he experienced in space mirrors much of what people have had to manage amid the COVID-19 pandemic. One way he dealt with isolation and continues to do so today is by keeping a positive attitude and reminding himself that negative experiences will not last forever. Other things that have helped him through isolation include getting physical exercise and taking on art projects.
"When I was in space, I took pictures and I helped film a movie, "A Beautiful Planet," which is really helping me now because I'm kind of moving into the TV and film universe," he said. "So, I think if you can write a book or learn photography or start painting or whatever, doing something artistic I think is really good for the human brain."
Retired astronaut Clayton Anderson previously appeared on "Perspective," during which he admitted that one of the biggest challenges he faced while traveling through space was spending time with people he did not particularly like. Virts believes that experience is relatable both for astronauts and those who are self-isolating, and that it is something people should think about critically as the pandemic continues.
"That is super important. Look, you're not going to like everybody in life... even if you're married to someone that you love, if you're spending 24/7 for 200 days with them, that's going to get old after a while," he said.
Space traveling is "the ultimate isolation," he added. "Being stuck in a can with a few other people. Many of them are not even from your country… don't speak your language... Give yourself some personal space and some personal time. The technical aspects of spaceflight are hard and can kill you, but it's the psychological aspect that's even harder -- the interpersonal relationships -- because that is the ultimate quarantine."
Listen to the rest of this past week's highlights from "Perspective" here.