The Vilna Gaon teaches, "When a person loses a silver coin, he should praise Hashem as though he found one. And if he loses two silver coins, he should be happy as though he had found two silver coins. The same is true for every bad thing that happens to him; he should realize that the bad is good… והטובה היא לפי ערך הרעה, because the good is in accordance to the extent of the bad." This means that when things seem very bad, it is Hashem's kindness in concealment to an even greater extent.
Rav Shach zt'l brought a cup of tea with honey to a person suffering from enemies. Rav Shach said, "Bees frighten people and sometimes sting, but they give us honey. Similarly, regarding those who oppose you, trust that something sweet will come from it."
Reb Yitzchak Eizik of Zutchka zt'l writes the following story: A student asked his rebbe to teach him שיחות חיות ועופות, the languages of birds and animals because birds and animals can tell the future. His rebbe refused, saying that the student would be better off without this knowledge. "Do as Rashi writes on the pasuk, תמים תהיה עם ה' אלקיך, 'Go with Hashem with temimus [with the belief that Hashem leads us in the very best way]. Don't think about what the future holds. Rather, accept everything that happens to you with temimus.'"
But the student kept pestering his rebbe, so the rebbe obliged. One morning, the student heard the oxen speaking that a plague was coming and all the barn animals would die. The student quickly sold all his cattle to a butcher. A month later, he heard a chicken say that disease is going to ruin his crops. The student quickly sold his crops. Once again, his wisdom saved him from financial loss.
A few days later, he heard an animal shouting, "Woe to our owner. He is about to die." The student ran to his rebbe. His rebbe replied, "The Zohar states, 'Some are punished with their lives, and others with their money.' Hashem wanted to punish you with your money to save your life. Hashem first decreed that your animals should die, which would save your life. But you sold your cattle. Then Hashem wanted to ruin your crops. But you sold your crops. The problem is that you don't have anything to grant you atonement; therefore, now the gezeirah is on your life!"
The lesson is to know that everything that happens to us is for our best. Sometimes we don't understand how it is for our good, but it is undoubtedly so.
A relative of Reb Eisik Sher of Slabodka zt'l broke her foot. Reb Eizik visited her and asked, "Do you remember the pain of pregnancy and childbirth? Are those bitter memories or happy memories? I'm certain they are happy memories because they brought you a child who gives you much nachas. Similarly, all suffering in life is like childbirth because something very good will come from it. We must believe that it is so."
The Or Hachayim writes, "All the characteristics of the parah adumah represent dinim (hardships). It's red, the color of harsh din. In fact, it must be completely red. It can't even have two black hairs. Another feature of the parah adumah is אשר לא עלה עליה עול that it never carried a yoke on its neck. This is because a yoke (hardships) removes din, as Chazal say, 'afflictions cleanses all sins,' and sins are din. The cow is burned in a fire, and fire is din. These aspects of din become concentrated in the ashes of the parah adumah, which pulls the tumah out of a man who came in contact with a human corpse."
The parah adumah's ashes represent a strong force of din – like a magnetic force – and it therefore attracts all dinim to it. When the ashes are sprinkled on the person who became tamei, the tumah, which is din, flees from him. This is because tumah is din, and the tumah gets drawn to the force of din in the ashes.