Life, the Universe and Everything by Douglas Adams
In Life, the Universe and Everything, the third title in Douglas Adams' blockbusting sci-fi comedy series, The Hitchhiker's Guide to the Galaxy, Arthur Dent finds himself enlisted to prevent a galactic war.
In consequence of a number of stunning catastrophes, Arthur Dent is surprised to find himself living in a hideously miserable cave on prehistoric Earth. However, just as he thinks that things cannot get possibly worse, they suddenly do. He discovers that the Galaxy is not only mind-boggingly big and bewildering but also that most of the things that happen in it are staggeringly unfair.
Escaping the end of the world for a second time, Arthur, Ford, and their old friend Slartibartfast embark (reluctantly) on a mission to save the whole galaxy from fanatical robots. Not bad for a man in his dressing gown . . .
Follow Arthur Dent's galactic (mis)adventures in the rest of the trilogy with five parts: So Long, and Thanks for All the Fish, and Mostly Harmless.