It's a big question and can't be fully answered with a simple one liner or one size fits all solution. We're gonna take a stab at answering this question.
It is a question every believer asks at some point during their lifetime. There is so much suffering in the world. There are examples of righteous people who suffered greatly, unrighteous people who suffered greatly. People who's suffering was a result of their own actions, and people who's suffering was a result of others actions, or just happened regardless of anyone's decisions. Whatever the category, everyone experiences suffering to some degree in their lifetimes.
Many disciples of Jesus have gone through great trials and afflictions for the God's sake. Examples of these disciples include:
D&C 121 1 O God, where art thou? And where is the pavilion that covereth thy bhiding place? And God responded.
7 My son, peace be unto thy soul; thine adversity and thine afflictions shall be but a small moment;
8 And then, if thou endure it well, God shall exalt thee on high; thou shalt triumph over all thy foes.
Job 3:11 Why died I not from the womb? why did I not give up the ghost when I came out of the belly?After Job endures his trials without ever blaming God, God comes to him and tells him we can't always understand why God does things. Sometimes we just need to trust God without understanding why He gave us a certain burden or when it's going to be lifted.
In Psalm 22:1 David foretells Jesus saying, "1 My God, my God, why hast thou forsaken me? Why art thou so far from helping me, and from the words of my roaring?" And Matthew 27:46 says, "46 And about the ninth hour Jesus cried with a loud voice, saying, Eli, Eli, lama sabachthani? that is to say, My God, my God, why hast thou forsaken me?" During the crucifixion of Jesus Christ.
The path of life cannot always be easy for any of us. There is too much refining needed for it to be easy. The process of God-directed purging and purifying will, of necessity, be wrenching and painful at times. So, in the midst of this refiner’s fire, rather than get angry with God, get close to God. Call upon the Father in the name of the Son. Turn to Them for daily bread. Walk with Them by the Spirit, day by day and step by step. Come truly to know Them and to truly know yourself. Let God prevail. No matter what our mortal experience may entail, we can trust God and find joy in Him.