Welcome to the daily chizuk (encouragement).
Although it appears to us that if someone is being afflicted or is suffering, that is a sign that Hashem is angry with them, the Gemara in Berachot tells us just the opposite. It says that the ones Hashem loves the most endure hardships and yissurim (afflictions). As the pasuk (verse) says, “The ones who Hashem loves the most are the ones that He chastises.” The Shechinah (Divine Presence) rests with someone who is afflicted.
The pasuk says that Yaakov Avinu offered sacrifices to Hashem, the God of his father Yitzchak. The Midrash there comments: Although Yitzchak was still alive at the time, and Hashem only attaches His name to someone after he leaves this world, since Yitzchak was a ba'al yissurim, since he was suffering, Hashem attached His name to Yitzchak even while he was still alive. Yissurim cleanse a person.
Rabbi Yaakov Galinsky told the story of a man who had no relatives and was on a respirator, suffering terribly. There was no hope of recovery, and the irreligious doctor attending to him decided on his own to pull the plug and take the man out of his anguish. A few days later, the man came back to the doctor in a dream and said, “I was supposed to live for four more days, and that affliction was going to allow me to get straight into Gan Eden. But now you cut my life four days short, and I'm missing those afflictions.” The doctor was all shaken up. He made teshuvah (repentance), and he became religious.
Chazal (the Sages) tell us that the greatest madregah (level) a person could reach is to accept the affliction with love. The Maharal says there is no greater achievement. The Vilna Gaon once lost one of his daughters the day before her wedding, and his mother came to him in a dream and told him, “If you knew what you accomplished by accepting this, you would have danced at her funeral more than you would have at her wedding.” The Midrash says that if Iyov, who suffered tremendously, had accepted his affliction without complaining, then we would have added his name to the Amidah. We would have said, “Elokei Avraham, Elokei Yitzchak, Elokei Yaakov, Elokei Iyov” (God of Abraham, God of Isaac, God of Jacob, God of Job).
But this sounds so foreign to us. How could I be happy when I'm in pain? But this is precisely why it's such a high level. But it's not all or nothing. There are different levels. The Slonim Rebbe said, “If a person is happy when they are in pain—if a person is not on the level to accept his afflictions with joy—it's a very high level just to know that you're supposed to accept them with joy.” It's very difficult, and we don't ask for affliction. The Rabbis of the Gemara already said, “Lo hen ve'lo secharan: Don't give us the afflictions and don't give us the rewards.” The Maharal explains that they were afraid of not dealing with them properly. But if a person is being afflicted, they have an opportunity to reach the highest level possible. Even if they aren't happy, just the fact that they don't complain and continue to serve Hashem is so powerful.
Rashi writes in Masechet Sanhedrin that if a person is doing good deeds in his life, like giving charity, and even so starts to suffer, does not complain, but continues to do his good deeds anyway, he is considered a Tzadik Gamur, a complete righteous man. Everyone on their own level can become a Tzadik (righteous person) with whatever afflictions they have. There was a Rabbi who had to undergo a certain painful treatment. Before each one, he said, “I am now ready to accept my affliction with love.” And there are regular people who have hard lives and manage to stay religious and continue to get close to Hashem despite their hardships. Both types of people bring tremendous...
Besides all the spiritual gain that these attitudes bring, they also enable us to cope with life's problems and give us the ability to stay strong and carry on our lives as usual.
Have a great day.

