Arthur Schopenhauer said this quote

Unless suffering is the direct and immediate object of life, our existence must entirely fail of its aim. It is absurd to look upon the enormous amount of pain that abounds everywhere in the world, and originates in needs and necessities inseparable from life itself, as serving no purpose at all and the result of mere chance. Each separate misfortune, as it comes, seems, no doubt, to be something exceptional; but misfortune in general is the rule.I know of no greater absurdity than that propounded by most systems of philosophy in declaring evil to be negative in its character. Evil is just what is positive; it makes its own existence felt.