Friedrich Nietzsche said this quote

He who has a why to live for can bear almost any how.