In the Book of Mormon we read that King Limhi sent a proclamation to his people asking them to gather at the temple so he could speak to them. After they had gathered, he told them to be comforted because in spite of their struggles the time was at hand when they would no longer be in subjection to their enemies. He told them to rejoice, and put their trust in God--the same God who had brought the children of Israel out of Egypt, parted the Red Sea, and given them manna to eat in the wilderness. And this is also the same God who had brought them out o Jerusalem and preserved them. He told them that it was only because of their iniquities that they had been brought into bondage and suffered many things. If hey had not transgressed, the Lord would not have suffered this great evil to come upon them. They had even slain a prophet who had prophesied of things to come, even Jesus Christ. When people sow filthiness, they shall reap destruction. Because of their wickedness, they were smitten and afflicted. However, if they would not turn to the Lord with full purpose of heart and put their trust in Him, serving them with all diligence, the Lord would deliver them from bondage. This is a message of hope for all of us--in spite of the sins we've committed in the past, we can turn our lives around and repent, and the Lord will again bless us. Mosiah 7:17-33 "And now, it came to pass on the morrow that king Limhi sent a proclamation among all his people, that thereby they might gather themselves together to the temple, to hear the words which he should speak unto them. And it came to pass that when they had gathered themselves together that he spake unto them in this wise, saying: O ye, my people, lift up your heads and be comforted; for behold, the time is at hand, or is not far distant, when we shall no longer be in subjection to our enemies, notwithstanding our many strugglings, which have been in vain; yet I trust there remaineth an effectual struggle to be made. Therefore, lift up your heads, and rejoice, and put your trust in God, in that God who was the God of Abraham, and Isaac, and Jacob; and also, that God who brought the children of Israel out of the land of Egypt, and caused that they should walk through the Red Sea on dry ground, and fed them with manna that they might not perish in the wilderness; and many more things did he do for them. And again, that same God has brought our fathers out of the land of Jerusalem, and has kept and preserved his people even until now; and behold, it is because of our iniquities and abominations that he has brought us into bondage. And ye all are witnesses this day, that Zeniff, who was made king over this people, he being over-zealous to inherit the land of his fathers, therefore being deceived by the cunning and craftiness of king Laman, who having entered into a treaty with king Zeniff, and having yielded up into his hands the possessions of a part of the land, or even the city of Lehi-Nephi, and the city of Shilom; and the land round about— And all this he did, for the sole purpose of bringing this people into subjection or into bondage. And behold, we at this time do pay tribute to the king of the Lamanites, to the amount of one half of our corn, and our barley, and even all our grain of every kind, and one half of the increase of our flocks and our herds; and even one half of all we have or possess the king of the Lamanites doth exact of us, or our lives. And now, is not this grievous to be borne? And is not this, our affliction, great? Now behold, how great reason we have to mourn. Yea, I say unto you, great are the reasons which we have to mourn; for behold how many of our brethren have been slain, and their blood has been spilt in vain, and all because of iniquity. For if this people had not fallen into transgression the Lord would not have suffered that this great evil should come upon them. But behold, they would not hearken unto his words; but there arose contentions among them, even so much that they did shed blood among themselves. And a prophet of the Lord have they slain; yea, a chosen man of God, who told them of their wickedness and abominations, and prophesied of many things which are to come, yea, even the coming of Christ. And because he said unto them that Christ was the God, the Father of all things, and said that he should take upon him the image of man, and it should be the image after which man was created in the beginning; or in other words, he said that man was created after the image of God, and that God should come down among the children of men, and take upon him flesh and blood, and go forth upon the face of the earth— And now, because he said this, they did put him to death; and many more things did they do which brought down the wrath of God upon them. Therefore, who wondereth that they are in bondage, and that they are smitten with sore afflictions? For behold, the Lord hath said: I will not succor my people in the day of their transgression; but I will hedge up their ways that they prosper not; and their doings shall be as a stumbling block before them. And again, he saith: If my people shall sow filthiness they shall reap the chaff thereof in the whirlwind; and the effect thereof is poison. And again he saith: If my people shall sow filthiness they shall reap the east wind, which bringeth immediate destruction. And now, behold, the promise of the Lord is fulfilled, and ye are smitten and afflicted. But if ye will turn to the Lord with full purpose of heart, and put your trust in him, and serve him with all diligence of mind, if ye do this, he will, according to his own will and pleasure, deliver you out of bondage."
In the Old Testament we read about how the Lord chastised Job's friends and accepted Job. The Lord blessed Job and gave him more than he'd had before all this happened. When we endure in righteousness, all will eventually be well with us. Job 42:7-17 "And it was so, that after the Lord had spoken these words unto Job, the Lord said to Eliphaz the Temanite, My wrath is kindled against thee, and against thy two friends: for ye have not spoken of me the thing that is right, as my servant Job hath. Therefore take unto you now seven bullocks and seven rams, and go to my servant Job, and offer up for yourselves a burnt offering; and my servant Job shall pray for you: for him will I accept: lest I deal with you after your folly, in that ye have not spoken of me the thing which is right, like my servant Job. So Eliphaz the Temanite and Bildad the Shuhite and Zophar the Naamathite went, and did according as the Lord commanded them: the Lord also accepted Job. And the Lord turned the captivity of Job, when he prayed for his friends: also the Lord gave Job twice as much as he had before. Then came there unto him all his brethren, and all his sisters, and all they that had been of his acquaintance before, and did eat bread with him in his house: and they bemoaned him, and comforted him over all the evil that the Lord had brought upon him: every man also gave him a piece of money, and every one an earring of gold. So the Lord blessed the latter end of Job more than his beginning: for he had fourteen thousand sheep, and six thousand camels, and a thousand yoke of oxen, and a thousand she asses. He had also seven sons and three daughters. And he called the name of the first, Jemima; and the name of the second, Kezia; and the name of the third, Keren-happuch. And in all the land were no women found so fair as the daughters of Job: and their father gave them inheritance among their brethren. After this lived Job an hundred and forty years, and saw his sons, and his sons' sons, even four generations. So Job died, being old and full of days."
A verse with a thought booklet tells us that the Lord is good and His tender mercies are over all His works. Psalms 145:9 "The Lord is good to all: and his tender mercies are over all his works."