Arthur Schopenhauer said this quote

If the immediate and direct purpose of our life is not suffering then our existence is the most Ill-adapted to its purpose in the world: for it is absurd to suppose that the endless affliction of which the world is everywhere full, and which arises out of the need and distress pertaining essentially to life, should be purposeless and purely accidental. Each individual misfortune, to be sure, seems an exceptional occurrence; but misfortune in general is the rule.