Psalm 9:7-8

But the LORD shall endure for ever: He hath prepared His throne for judgment.
And He shall judge the world in righteousness, He shall minister judgment to the people in uprightness.

King David comforts himself in this psalm by focusing on eternity.  He knows that his eternal security is in God.  Everything around him in his lifetime was temporary, just as everything around us is temporary.  Nothing we see now will last.  2 Peter 3:10b points out, "...the elements shall melt with fervent heat, the earth also and the works that are therein shall be burned up."  Nothing here in this life is going to last, except for man's spirit.  Our spirits will live for eternity in either heaven or hell, depending on whether we placed our faith in Jesus.  The LORD will be the Judge of where we spend our eternity, because He is the Righteous Judge (2 Timothy 4:8).  

God sits on His throne;  He has set Himself in His sovereign position.  He will judge the world according to His righteous standards.  The psalmist understands this and consoles Himself accordingly.  David knows that God will determine the fate of all, the righteous and the wicked.  He will make no exceptions to forget the righteous, as He will make no exceptions to exact His wrath against the wicked.  He will protect the righteous, either by His power here on earth or by escorting us into His presence in heaven.  

Believers, console yourselves with the knowledge that the LORD is still in control.  I know the world has gone mad.  I know that things don't look good.  I know the church is under attack.  I know that that God-ordained institutions such as marriage and family are under assault.  I know that we have embraced the culture of death and the sodomite lifestyle.  I know that jobs are hard to find, prices are high, and things are desperate.  But none of this is outside of the power of God.  King David trusted God when times were tough.  Let's imitate David and trust God in the same way.