This is one of my favorite sections in the Doctrine and Covenants. Given while Joseph Smith was enduring an illegal imprisonment in a jail not much better than a basement, it covers pretty much everything.
The Doctrine and Covenants
The word of the Lord to Joseph Smith the Prophet, while he was a prisoner in the jail at Liberty, Missouri, March 1839 (see History of the Church, 3:300–301).
1–4, The ends of the earth will inquire after the name of Joseph Smith; 5–7, All his perils and travails will give him experience and be for his good; 8–9, The Son of Man has descended below them all.
1 The ends of the earth shall inquire after thy aname, and fools shall have thee in bderision, and hell shall rage against thee;
2 While the pure in heart, and the wise, and the noble, and the virtuous, shall seek acounsel, and authority, and blessings constantly from under thy hand.
3 And thy apeople 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 ahonor; and but for a small bmoment and thy voice shall be more terrible in the midst of thine enemies than the fierce clion, because of thy righteousness; and thy God shall stand by thee forever and ever.
5 If thou art called to pass through atribulation; if thou art in perils among false brethren; if thou art in bperils among robbers; if thou art in perils by land or by sea;
6 If thou art aaccused 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 bprison, and thine enemies prowl around thee like cwolves for the blood of the lamb;
7 And if thou shouldst be cast into the apit, or into the hands of murderers, and the sentence of death passed upon thee; if thou be cast into the bdeep; if the billowing surge conspire against thee; if fierce winds become thine enemy; if the heavens gather blackness, and all the elements combine to chedge up the way; and above all, if the very jaws of dhell shall gape open the mouth wide after thee, know thou, my son, that all these things shall give thee eexperience, and shall be for thy good.
8 The aSon of Man hath bdescended below them all. Art thou greater than he?
9 Therefore, ahold on thy way, and the priesthood shall bremain with thee; for their cbounds are set, they cannot pass. Thy ddays are known, and thy years shall not be numbered less; therefore, efear not what man can do, for God shall be with you forever and ever.