The Kamarna (Heichal HaBrachah Vayechi) writes, "I heard my Rebbe say to someone, 'Accept everything that happens to you with love, and then you will have both Olam HaZeh and Olam Haba.' The man replied that he will daven to have the strength to accept everything with love. The Rebbe replied, 'You spoke correctly. One has to daven for this.'"
There seem to be two opinions in Chazal, whether one should praise Hashem first and then state his requests, or visa versa, to first ask for his requests and then to praise Hashem. Based on the lesson above, the Kamarna said that one should first ask Hashem for strength to recognize that everything is for the good, and then he will be able to praise Hashem.
The Chofetz Chaim (Shem Olam ch.3 Hagah) writes in the name of the Vilna Gaon zy'a, "If it weren't for yesurim, בזה ורגלינו ידינו מצאנו לא העולם, we have no hope of earning Olam HaBa."
The Chofetz Chaim explains that after a person goes up to heaven, the yeusrim he suffered in his lifetime can change the heavenly court's verdict to a good decree. "Suddenly, a bas kol announces and asks, 'Where are the yesurim that he had in this world?' Immediately, all the yesurim he had throughout his life gather, and they all go to the right side of the scale. This turns the scale to the side of virtue.
This is because the yesurim removes his aveiros from him, and he becomes a tzaddik. When this occurs, he becomes happy and praises Hashem for the yesurim he endured." Chazal (Sifri Ha'azinu) says that Hakadosh Baruch Hu says, "Whenever I give you yesurim in this world, remember how much good I will give you because of it in the future world of Olam HaBa."