Are you maybe thinking of Viktor Frankl’s “Man’s Search for Meaning”?
Quite possibly; I know it was in a book, but one I never read. (That is, I heard the story second/third-hand.)