There has never been an easy answer, and it is known to be far more difficult in the doing than in the saying.
Consider the story of Rabbi Meizlish of Cracow and Warsaw, who was a well-to-do merchant before he became a rabbi.
Even then, when he was sending timber along the river to Germany to be sold there at a profit, he was famous for his erudition, and he used to teach brilliant pupils at the yeshivah.
Once the news came that the timber rafts were wrecked in a storm, and the whole of the rabbi’s fortune was lost in one day.
They did not know how to tell the rabbi and chose one of his favorite pupils to do so.
The young man selected a passage in the Talmud and came to the Rabbi with his question:
“It says here that one has to thank God with blessings for the evil that befalls one as well as for the good. How can this be done?”
The rabbi explained the matter in terms of its hidden meaning as well as in straightforward theology.
To this the pupil replied, “I am not sure I understand.
And if my rabbi were to learn that all his timber rafts were wrecked on the river, would he dance for joy?”
The rabbi said, ”Yes, of course.”
“Well then,” said the pupil, “you can dance-all the rafts are lost!”
Upon hearing this, the rabbi fainted.
When he came to, he said, “Now I must confess I no longer understand this Talmud passage.”
In other words, there is a difference between theoretically, knowing that God is always present and knowing it when one is crushed.
To be sure, there are many saints, and even ordinary men, who are able to bless the evil as well as the good, not only to receive it without complaint, but also to accept it with joy.
–Rabbi Adin Steinsaltz