The Psalms offer many reasons for long term optimism – optimism for the future, even if everything around you now seems dark and your fortune looks grim. God's promises in the Psalms are our reason for long-term optimism. In the Book of Psalms, David (and many other psalmists) sing praises to God in spite of their difficulties, because they have reason to put their faith in Him and they rejoice at his promises to them. The greatest of God's promises is the guarantee of life after death, an eternity in heaven with Him. This is a great promise indeed, but it will only come to pass after our deaths, which must inspire us to keep our faith and hope in Him until then.
A fantastic example of the long-term optimist is David, who time and time again came up against his enemies, both enemies of the flesh and enemies of his own sin, and time and time again he finished all of these trials with a song of praise to God, in whom he had put his faith and trust. David relied upon God to bear him through his hardest times, and God did not abandon his servant. God never abandons those who put their faith and hope in Him, and this is why we are to have long-term optimism.