Those who know God rejoice in His goodness, and they express their praise in song and shout for joy. We experience God’s goodness in the wonders of creation, and in the good gifts He has given us. But joy in God is not just for the “good times” in life.
If we look at the rest of the psalm, we see that experiencing God’s goodness includes going through times of danger, seeing God deliver His people from situations that would have been hopeless without Him. Even while going through trouble, those who know God have faith that He will bring them through, as He has for His people so many times before.
Often God works in our lives through other people. When God takes care of the widows and orphans and people who are strangers in the place they are living, as this psalm assures us He does, it is usually through other people who provide for their physical and emotional needs. But the psalm also warns us against putting our ultimate trust in people. They will always let us down at some point. But God never will.