We are taught by the rabbis that whenever something happens that seems to be bad, we should say, "Everything the Merciful One does is for good" or "This also is for good."

Yitzhak Buxbaum, Jewish Spiritual Practices