The Hasidic texts speak a great deal about what is expected of one who is having troubles.
A person under great hardship tends to think more and more of himself, which encourages egotism.
His suffering can then have the effect of ruining his soul and degrading his character.
To prevent this, the sufferer must see his own problem as more than a personal sorrow and place it instead … as a representation of the Shekhinah, the presence of God.
When an individual Jew suffers, the Shekhinah weeps, and God, as it were suffers.
Therefore, a person must beseech God, “Act for Your own sake.”
… [The suppliant] must lower his ego and address God: “I myself am not important. I am not unusually gifted or exceptionally learned. However, I am a portion, a spark, of the heavenly divine. And so I ask you to act for Your own sake.”
When a person turns to God in this way, he has already done the tikkun, the correction of the egotistical desires.
Rabbi Adin Steinsaltz