Anyone interested in this would do well to read Victor Frankl's "Man's Search For Meaning" about his imprisonment in Auschwitz.[1] He found that a sense of meaning was critical to survival there, and went on to develop a new school of psychotherapy he called "logotherapy", which focused on finding meaning in life.[2]
[1] - https://www.amazon.com/Mans-Search-Meaning-Viktor-Frankl/dp/...
[2] - https://en.wikipedia.org/wiki/Logotherapy