In Psalm 87 we read how God loves Zion, used in this case to mean Jerusalem. There is an obvious tone of joy with this Psalm.
But Psalm 88 is full of anguish. The writer is pouring out his heart to God. In the opening, he confesses that God is his savior, and immediately begins telling God about the anguish he is in, and seems to wrap up by saying that it is God who has put him in this place. And yet, remember how the author opened, with a confession that God is his savior. So as bad as things are, there is hope.
And then Psalm 89 begins with praises to God with all of His love, majesty, faithfulness, might, righteousness and justice. And the covenant that God made with David is remembered, but David’s descendants have forsaken God’s law, and therefore God has withdrawn his protection and blessings from Israel. And then the Psalm ends much as it begins, with promises of eternal praise to God.
The fact is that despite outward circumstances, God is worthy of praise. He is worthy when life is good, and He is worthy when life is hard. He is our savior in both places. He does not change, but our surroundings do. He is eternal, our lives here on earth are just a spark, a fleeting moment in time.