Section 122 of the Doctrine and Covenants has a number of promises made to Joseph concerning his future.
Section 121:1-9, Doctrine and Covenants, The Church of Jesus Christ of Latter-day Saints, accessed July 23, 2024
1 The ends of the earth shall inquire after thy name, and fools shall have thee in derision, and hell shall rage against thee;
2 While the pure in heart, and the wise, and the noble, and the virtuous, shall seek counsel, and authority, and blessings constantly from under thy hand.
3 And thy people shall never be turned against thee by the testimony of traitors.
4 And although their influence shall cast thee into trouble, and into bars and walls, thou shalt be had in honor; and but for a small moment and thy voice shall be more terrible in the midst of thine enemies than the fierce lion, because of thy righteousness; and thy God shall stand by thee forever and ever.
5 If thou art called to pass through tribulation; if thou art in perils among false brethren; if thou art in perils among robbers; if thou art in perils by land or by sea;
6 If thou art accused with all manner of false accusations; if thine enemies fall upon thee; if they tear thee from the society of thy father and mother and brethren and sisters; and if with a drawn sword thine enemies tear thee from the bosom of thy wife, and of thine offspring, and thine elder son, although but six years of age, shall cling to thy garments, and shall say, My father, my father, why can’t you stay with us? O, my father, what are the men going to do with you? and if then he shall be thrust from thee by the sword, and thou be dragged to prison, and thine enemies prowl around thee like wolves for the blood of the lamb;
7 And if thou shouldst be cast into the pit, or into the hands of murderers, and the sentence of death passed upon thee; if thou be cast into the deep; if the billowing surge conspire against thee; if fierce winds become thine enemy; if the heavens gather blackness, and all the elements combine to hedge up the way; and above all, if the very jaws of hell shall gape open the mouth wide after thee, know thou, my son, that all these things shall give thee experience, and shall be for thy good.
8 The Son of Man hath descended below them all. Art thou greater than he?
9 Therefore, hold on thy way, and the priesthood shall remain with thee; for their bounds are set, they cannot pass. Thy days are known, and thy years shall not be numbered less; therefore, fear not what man can do, for God shall be with you forever and ever
Commenting on the fulfillment of vv. 1-2, Jeff Lindsay (https://www.jefflindsay.com/LDSFAQ/FQ_prophecies.shtml) wrote:
That prophecy has been fulfilled. Joseph could have been killed in that prison, unable to return to his friends as promised in Section 121. Instead, in April 1839, after six months of illegal imprisonment, someone in authority acted to allow the Mormon prisoners to escape during a change of venue, perhaps desiring to avoid public embarrassment by having a trial without evidence. Joseph and his brother Hyrum , about 10 days after being allowed to escape, arrived in Quincy, Illinois and found their families impoverished but alive and healthy. As was prophesied in verse 9 of Section 121, Joseph was greeted by "friends do stand by thee," and did greet him again "with warm hearts and friendly hands."
Joseph and the Church could have been destroyed by their persecutors. Joseph's few years as leader of a small and hated group could have ended in obscurity. Instead, the name of Joseph Smith is known across the world today, as was prophesied. Hell rages against the name of Joseph Smith, as enemies devise every manner of lie to slander Joseph and the Latter-day Saints, while millions seek counsel, authority, and blessings that have been given to us from Christ, revealed and restored through the Prophet Joseph Smith.
Commenting on vv. 3-9, Lindsay wrote:
That such inspiring words were written under the dismal conditions of the Liberty Jail in Missouri is a witness of the character of the Prophet Joseph Smith. In addition, the prophecy about future imprisonments and persecutions was accurate. Joseph would be killed 5 years later by conspiring enemies of the Church while he was held in another prison, Carthage Jail in Illinois. In spite of all the attacks on Joseph and all the slander, the Latter-day Saints have not been turned away from Joseph. He is loved for the honorable man that he was and for his role as a prophet of Jesus Christ. His greatest legacy as a Prophet, in my opinion, is the Book of Mormon: Another Testament of Christ, which is held in ever increasing respect by those who read it and follow its teachings. Those who read it sincerely and pray about it come to know with the heart and the mind that Joseph was a prophet of God. After being mocked for 150 years by enemies of the Church, the Book of Mormon stands stronger than ever, with many thinkers - including some non-LDS scholars - being impressed and moved not only by the text but also by the intellectual evidences of authenticity.
In fact, long before the prophecies in March of 1839 now recorded in the Doctrine and Covenants, Joseph prophesied that he and his fellow prisoners would not be killed. On the morning of November 3, 1838, after Joseph had been arrested and while he and other prisoners were on the road to Independence under the watch of guards, he told his brethren to be of good cheer, for "the word of the Lord came to me last night that ... whatever we may suffer during this captivity, not one of our lives shall be taken" (Dona Hill, Joseph Smith: The First Mormon, Doubleday and Company, Garden City, NY, 1977, p. 244). But there was little reason for such optimism at the time. In fact, his enemy, General Lucas, whose troops had taken Far West and who seemed gleeful about the Extermination Order, had just told the Saints, "As for your leaders, do not think - do not imagine for a moment - do not let it enter your minds that they will be delivered, or that you will see their faces again, for their fate is fixed - their die is cast - their doom is sealed" (Hill, p. 243, citing History of the Church, Vol. 3, pp. 202-204). But Joseph and his companions survived and returned, as prophesied.