From Fortunate Nation by Rabbi Avigdor Miller
"And you shall remember Hashem your G- d, for it is he that gives you strength to acquire wealth in order that he establish his covenant that he swore to your fathers" (Devarim 8:18).
There are two ways to remember Hashem and to become more righteous: (1) because of adversity and suffering, (2) or because of prosperity and happiness.
To remember Hashem because of prosperity is the best way, (1) because Hashem prefers to bestow happiness rather than to send misfortune (“For He desires Kindliness” Micha 7:18); (2) because the emotion of gratitude engenders love of Hashem and eagerness to conform to His will, which is preferable to conformance which results from adversity.
By using your happiness to become more righteousness, you facilitate Hashem’s great plan for you
Thus the first opportunity for the continued excellence of Man was offered in the Garden of Delight, which was full of the most luscious and beautiful fruit (Breishis 2:9). When the healthy young man, and the prosperous and powerful man, utilize their happy state to be grateful to Hashem and become therefore more devoted to His service, it is much more deserving of reward than when one improves himself as a result of reprimand and chastisement.
By utilizing your happiness as the cause of continued righteousness, you thereby facilitate and expedite Hashem’s great plan for you. It is true that even repentance caused by suffering would also be rewarded, but the end-result comes much more speedily when we are motivated by joyous and happy Gratitude.