Jesus Christ was the master teacher, He showed us how to live our lives and what we must do in order for us to gain eternal salvation. The first principle of the Gospel is Faith in Jesus Christ and His Atonement. Faith that He is the Only Begotten Son of God, and Savior and Redeemer of the world.
The Prophet Joseph Smith suffered many trials and tribulations in His lifetime as He worked to restore the Gospel of Jesus Christ to the earth. Many people persecuted him and his followers. Eventually, he was murdered. While suffering in liberty jail, after being falsely accused, The Lord comforted him saying: "My son, peace be unto thy soul; thine adversity and thine afflictions shall be but a small moment; And then, if thou endure it well, God shall exalt thee on high; thou shalt triumph over all thy foes" D&C 121:7-8
Why do bad things happen to good people? As a missionary, that is a common question I get asked. My simple answer, because He loves us enough to teach us.
During my life, I have discovered not only how much God loves me, but how important His plan is for me. God is the author of our lives. At times it may seem like we are running the show, but really, it is all Him. He has given us all that we have, everything from our bodies, to our possessions to life itself. There is nothing we have that does not belong to our Father in Heaven. Thus, there is pretty much nothing that we can give back to Him. Nothing except our will. Our will and the agency behind will are the only factors in life that we control.