This advice is repeatedly given throughout scripture. The Lord instructed Joshua directly:
Joshua 1:6 Be strong and of a good courage: for unto this people shalt thou divide for an inheritance the land, which I sware unto their fathers to give them.
7 Only be thou strong and very courageous, that thou mayest observe to do according to all the law, which Moses my servant commanded thee: turn not from it to the right hand or to the left, that thou mayest prosper whithersoever thou goest.
9 Have not I commanded thee? Be strong and of a good courage; be not afraid, neither be thou dismayed: for the Lord thy God is with thee whithersoever thou goest.
Moses had given Joshua the same instruction before:
Deuteronomy 31:6 Be strong and of a good courage, fear not, nor be afraid of them: for the Lord thy God, he it is that doth go with thee; he will not fail thee, nor forsake thee.
7 ¶ And Moses called unto Joshua, and said unto him in the sight of all Israel, Be strong and of a good courage: for thou must go with this people unto the land which the Lord hath sworn unto their fathers to give them; and thou shalt cause them to inherit it.
23 And he gave Joshua the son of Nun a charge, and said, Be strong and of a good courage: for thou shalt bring the children of Israel into the land which I sware unto them: and I will be with thee.
Moses assures Joshua that God will not fail or forsake him. Then Moses drops a truth bomb:
29 For I know that after my death ye will utterly corrupt yourselves, and turn aside from the way which I have commanded you; and evil will befall you in the latter days; because ye will do evil in the sight of the Lord, to provoke him to anger through the work of your hands.
Moses sought diligently to sanctify the people. He took Israel out of Egypt, but he could not take Egypt out of Israel. They were idolatrous, whoring after their idols and pursuing their covetous ways. Now in the latter days, we are no different. But though we may utterly corrupt ourselves and fail, God will never fail us. As long as we continually repent and strive to do His will, He will lift us up at the last day. Have the courage of Shadrach, Meshach, and Abednego in the book of Daniel to stand in the fire if necessary and if you die, you die unto the Lord. We must not let our courage fail like the ancient Israelites who stood afar off and feared to heed the Lord as we read in Exodus.

Exodus 20:18 ¶ And all the people saw the thunderings, and the lightnings, and the noise of the trumpet, and the mountain smoking: and when the people saw it, they removed, and stood afar off.
19 And they said unto Moses, Speak thou with us, and we will hear: but let not God speak with us, lest we die.
20 And Moses said unto the people, Fear not: for God is come to prove you, and that his fear may be before your faces, that ye sin not.
21 And the people stood afar off, and Moses drew near unto the thick darkness where God was.

Or as Truman G. Madsen once explained:
“Said the Prophet Joseph Smith after one of the most revelatory meetings in his life, “There was nothing made known to these men [the Twelve] but what will be made known to all the Saints of the last days, so soon as they are prepared to receive” (TPJS, p. 237). This is the religion of every man. Not “Take my word for my experience,” but “Duplicate it in your own life.” How far do I go with this? All the way.
Let me then come to a close. I have hiked, with my wife and at night, all the way from the base of what is known as Mt. Sinai to the top…we were able to recollect that Moses, there, had face-to-face communion with God. He came back down and said to the children of Israel, in the name of the God whose name he knew, “Now, you are invited to go back up with me.”
And they said, “Thank you. No. That’s for prophets. That’s for people who are a bit fanatical. We will stay here and you go up, Moses.”
In his absence they built an idol. The power of religious impulses goes in many directions. They built an idol—a thing—and were denied the privileges of Moses (D&C 84:23–25). That is what our generation is now doing again. We are staying down below and then claiming superiority for our judgment in doing so.” (Source: Truman G. Madsen, On How We Know, BYU Devotional Address, Sept. 20, 1994)
Forsake your vain and idle pursuits. Pursue Jesus Christ only. In the fast approaching time of destabilization, scarcity, and fear, you must be strong and of a good courage. God will not fail you. The war has already been won. You need only be on the right side when it is over.
Amen! We must find safety only in the Lord Jesus Christ.
Here is a link to the Isaiah Institute, which has many scriptural resources and studies concerning what you posted above.
https://isaiahinstitute.com/fighting-against-zion/
“Many who read in the scriptures of people “fighting against Zion” may assume they refer only to non-members of the church. A search, however, may disabuse our minds on that subject. First, “He that fighteth against Zion, both Jew and Gentile, both bond and free, both male and female, shall perish; for they are they who are the whore of all the earth” (2 Nephi 10:16). Those who fight against Zion, in other words—whatever name they go by—belong to the great and abominable church of the devil, which “fight[s] against the Lamb of God” (1 Nephi 14:13).”