Yosef, Yakov’s son, has become the 2nd most powerful person in the world!
Yosef’s brothers, who years before had hated him, thrown him into a pit, caused him to be sold into slavery and told their own father that Yosef, his favorite son, had been torn to death by a lion, now stand before Yosef himself, who has become master of Egypt second only to Pharoah.
Yosef has just revealed himself to them.
They stand, guilt-ridden and fearful for their lives. “נבהלו מפניו” — they recoil from before him, in fear. 
But Yosef tells them, “אל תעצבו ואל יחר בעיניכם” — “Don’t be troubled; don’t be angry with yourselves ['Don't be worthy of anger in your own eyes'].” 
He had himself come long before to realize that whatever had happened to him was G-d’s Will for an ultimate Good. To do this, Yosef first had to accept the yoke of the “Malchut ha-Shamayim” — the “Kingdom” or “Kingship” of “Heaven;” i.e. G-d’s Rule over all that happens. G-d, and only G-d, is managing all events. Accepting G-d’s Rule, Yosef had then only to let go.
Let go: Don’t judge, don’t guess, don’t expect, don’t try to understand, don’t control, don’t regret, don’t blame, and so on.
Torah doesn’t tell us at exactly what point in his life he made this realization, which he inherited from Avraham, Yitzhak and Yakov, his own. It might have come to full fruition while he was imprisoned after the false accusation by Potiphar’s wife. But by the time of his rapprochement with his brothers, it was his own realization, too. With it, he had accepted whatever happened to him, let go and found a degree of peace:
“Among the worldly advantages of trust in G-d are…: a heart at rest, without worldly cares; a tranquil spirit, liberated from mental disturbance and free from the pain of the lack of physical enjoyments.” 
“…he rejoices, whatever the situation in which he’s placed, even if it’s contrary to his nature, because he always trusts that G-d will do nothing but what’s for his good in all things, just as a tender mother acts towards her infant child — bathing it, diapering it … — all without regard to the infant’s will, as David, peace on him, said, ‘I’ve stilled and quieted my soul like a weaned child with his mother… ‘.” 
Recognizing G-d as the Source of all that had happened, letting go of all outcomes, Yosef could also hold no grudge against his brothers. They’d only been G-d’s agents for an ultimate Good: “It wasn’t you who sent me here, but G-d.” 
Precisely the same is shown in an incident several hundred years later. David, who has become King in place of Sha’ul, is cursed and pelted with stones by Shimei, a relative of Sha’ul’s. As David’s bodyguard seeks to assault Shimei, David stops them:
But the king [David] said [to his guards], “…If [Shimei] is cursing, it’s because the Lord said to him, ‘Curse David.’ Who can ask, ‘Why do you do this’?”
David then said to Abishai and all his officials, “…Leave him alone; let him curse, for the Lord has told him to.” 
In prison, Yosef might also have blamed himself for provoking his brothers through his own naive arrogance. But he must have come to see that his remorse was of no use if it led only to sadness, and not to a change in his behavior:
“Obsessive guilt feelings control a person’s thoughts. The person keeps telling himself how awful he is. He sees no hope of improvement and his guilt feelings prevent him from taking joy in doing the right things. Such guilt feelings need to be overcome because they are so counterproductive.” 
No matter how much wrong we do, we’re no less in G-d’s Presence, although we might be less aware of it (as were Adam and Havah after eating the fruit). The prophet says: “Your sins separate you from G-d.”  The spiritual challenge is to transcend that sense of separation by recognizing G-d’s midat Hesed (G-d’s Lovingkindness) with our hearts:
“We don’t present our supplications before You because of our righteousness, but because of Your abundant mercy.” 
“You may feel that G-d rejects you because of your sins…but remain strong and throw yourself before G-d…This is the way you overcome G-d. G-d has great joy when you conquer Him this way.” 
Recognizing his mistakes, Yosef must yet have forgiven himself. His flaws had served the same Ultimate Good that his brothers’ acts of malice had.
“Sometimes people suffer from mistakes or failures that seem to be their own fault. In such a case, we need to remember…: Before making a mistake, a person has apparent free choice not to make a mistake. But after…one must believe that HaShem willed the mistake! Knowing that HaShem willed the mistake, a person has no reason to be disappointed, depressed, disheartened, and certainly not self-flagellating or guilt-ridden.” 
This is a higher level of realization than if he had made no mistakes at all:
“…R. Abbahu said: In the place where penitents stand, even the perfectly righteous can’t stand.” 
Accepting G-d’s Rule over all things — worshiping G-d, loving G-d — Yosef was able to forgive and accept all (including himself, Potiphar and Potiphar’s wife) in peace.
But — Didn’t Yosef’s brothers inherit the same tradition about G-d’s Rule that he did? Why, then, was he able to forgive them to a degree that they could not forgive themselves (and for which they feared him)?
The “idea” of G-d’s Rule is far different from the “experience” of it. With the “idea” of it alone, it’s as if we’re “outsiders” looking at it without necessarily being part of it. With the the “realization” of G-d’s Rule, which might begin with the “idea,” comes the experience of G-d’s actual Presence. In that Presence, we experience Shabbat-like peace, even in the most perplexing circumstances. We’re not separate from the Presence; the Presence isn’t separate from us.
Later Judaism calls this “d’vekut” — “union” with G-d, of which there can be multiple levels.
“D’vekut” corresponds to the Sanskrit “Samadhi,” a term familiar from the Yoga tradition. Samadhi is the ultimate goal of yogic practices; especially meditation.
Yet, Yoga seems to talk of “G-d” in “impersonal” terms (e.g. as Brahman), unlike the extremely “personal” terms used by Torah.
Is this love and worship of G-d in opposition to the spiritual practices of Yoga that lead to Samadhi — the eighth in Patanjali’s “limbs” of spiritual development through Yoga?
On the contrary. Loving G-d can be an alternative means to Samadhi. In fact, it might even be a necessary part of the process.
The Sanskrit term for a “personal” G-d is “Isvara,” which embodies both the personal and impersonal attributes of G-d.
“…Isvara Pranidhanam or devotion to the all-knowing Isvara [the supreme Cosmic Soul; G-d] is another method for obtaining samadhi. It is the emotional path which is easier than the other methods mentioned…Just surrender yourself unto Him, saying ‘I am Thine; all is Thine; Thy Will be done. The moment you have resigned yourself completely, you have transcended your own ego…Once we say ‘I can’t do anything; it is You,’ we have risen above nature.” 
Maharishi Mahesh Yogi, who brought TM from India to the rest of the world, makes the same point:
“Those who are highly emotional…may even transcend through an increasing feeling of love for [G-d] during the process of making offerings.” 
When we’re worried, angry, sad, and so on, we can make an “offering” by putting all events in G-d’s Hands. We can choose to allow G-d to decide the outcome of any situation and adjust ourselves to that outcome — all with the knowledge that all G-d does is for the Good. When we do so sincerely, and then let go, we’re filled with peace and bliss. The bliss of transcending. The bliss of Eden.
In Jewish tradition, this “love of G-d” is called “hasidut.” While there have been multiple “hasidic” movements within Jewish history (the hasidim ha-rishonim mention in the Talmud; the Hasidei Ashkenaz of the Middle Ages; the Hasidic movement founded in the 18th century by the Ba’al Shem Tov), the term itself refers to intense devotion. Its Hebrew root is related to “hesed” — the same word used for Divine Lovingkindness.
Thus, Yosef, surrendering to G-d, accepting G-d’s Will in all things and events, annihilates his sense of separateness from G-d. He’s freed from sorrow, from regret, from resentment; he easily forgives all.
What he does is what we should — and can — be doing, if we would be peaceful and loving ourselves.