Last semester, my Book of Mormon teacher taught about the different types of trials that we face. The tests that God intends for us to experience she named "tutorials." We are taught things--about ourselves and about the good nature of God. We are taught about the opposition between despair and happiness. I couldn't have put it any better than this:
"Surely it is better to find the goodness of God and the grace of Christ, even at the price of despair, than to risk living our lives in a moral or material complacency that has never felt any need for faith or forgiveness, and need for redemption or relief."
-Elder Jeffrey R. Holland
These trials are tutorials, where God will try to teach us something. As the student, we have the responsibility to learn. This often means that we must humble ourselves and accept God's plan. We must be submissive, meek, and willing to change. Which leads to the next quote:
"The purpose of the gospel is to transform common creatures into celestial citizens, and that requires change."
-Elder Dallin H. Oaks
Many people refer to this life as a time to be tested. I believe it's more than that. In Alma 42:10, it describes the natural man and then says that "this probationary state became a state for them to prepare; it became a preparatory state." What is it that we're preparing for? Celestial glory. The opportunity to be with God and like God. The power of eternal progression. The things that we learn here will prepare us to live there, in the presence of God.
Cool. We understand all this stuff. Now what? 2 Nephi (especially chapter 2) talks a lot about the ability to act and be not acted upon; the ability to let our behaviors rule over our thoughts and feelings. 2 Nephi 10:23 explains this: "Therefore, cheer up your hearts, and remember that ye are free to act for yourselves--to choose the way of everlasting death or the way of eternal life."
To learn is a choice. To submit to God's will is a choice. To change is a choice. To prepare is a choice. To act is a choice. And ultimately, happiness is a choice.