Leo Tolstoy said this quote

It's as if I had been going downhill when I thought I was going uphill. That's how it was. In society's opinion I was heading uphill, but in equal measure life was slipping away from me... And now it's all over. Nothing left but to die! So what's it all about? What's it for? It's not possible. It's not possible that life could have been as senseless and sickening as this. And if it has really been as sickening and senseless as this why do I have to die, and die in agony? There's something wrong. Maybe I didn't live as I should have done? came the sudden thought. But how can that be when I did everything properly? he wondered, instantly dismissing as a total impossibility the one and only solution to the mystery of life and death.