"If the foundations be destroyed, what can the righteous do?" (Psalm 11:3).
The word here for "foundations" is not the usual word for, say, a building foundation. Used rarely, a better translation of this word would be "purpose," or "basis." The fear expressed is not that the foundations of our faith might be undermined, but that we might lose our sense of purpose.
In the context of the psalm, David was in danger of becoming demoralized by the pressures of wicked desires and evil ambitions all around him, and Christians surely have the same problem today. Why should we try to maintain high standards of doctrinal integrity and moral purity when the people around us -- even most Christians -- seem to be occupied mostly with materialistic ambition and pursuit of pleasure? If we allow the devil to undermine the very purposes God has for our lives, wandering away from His will in favor of some temporal interest, then why even continue with a pretense of Christian living?
David's solution was simply to remind himself that "The Lord is in His holy temple, the Lord's throne is in heaven: His eyes behold, His eyelids try, the children of men" (v.4). He may allow the righteous to be tried for a season, but we must not forget that "the righteous Lord loveth righteousness" (v.7), and that "the wicked and him that loveth violence His soul hateth" (v.5).
When we are tempted to wonder whether it is really worth all the effort, and when our very foundation and purpose for living seems to be crumbling, we should remember that our God is Creator, Sustainer, and Judge of all -- that He still is on His throne, and that we who belong to Him have been "predestinated according to the purpose of Him who worketh all things after the counsel of His own will" (Ephesians 1:11). HMM