Sound advice has been offered by our Sages on cleansing one’s heart of all sadness and any trace of worry about mundane matters, even a sadness or worry caused by the lack of such essentials as children, health, or livelihood.
The advice is contained in the well-known saying of our Sages: “Just as one recites a blessing for his good fortune, so must he also recite a blessing for misfortune.”
The Gemara explains that this does not mean that he recite the same blessing; rather, the implication is that one should accept misfortune with joy, like the joy in a visible and obvious good.
For it, too, is for the good, except that it is not apparent and visible to mortal eyes, for it stems from the “hidden (spiritual) world,” which is higher than the “revealed (spiritual) world,” whence derives an apparent and revealed good.
For this reason, our Sages of blessed memory stated that the verse, ‘ואוהביו כצאת השמש בגבורתו’ refers to the reward of those who rejoice in their afflictions.
For one’s joy in affliction stems from the fact that being near to Hashem is dearer to him than anything of the life of this world, as it is written: ‘כי טוב חסדך מחיים’
Now, the nearness to Hashem is infinitely greater and more sublime in the “hidden world,” for ‘כי שם חביון עוזו’; and it is also written, ‘יושב בסתר עליון’
Therefore he is found worthy of seeing “the sun emerging in its might” in the World to Come, when the “sun” will emerge from the “sheath” in which it is hidden in this world, and will then be revealed.
This means that what is presently the “hidden world” will then be revealed, and it will shine forth and glow in a great and intense revelation upon all who seek refuge in Him in This World, taking shelter in his “shadow”, the “shadow of wisdom,” which is presently in a state of “shade” as opposed to revealed light and goodnes.
(Lessons in Tanya Chapter 26)