In these verses the writer addressed the congregated nation, not God. This is declarative praise. God had answered the psalmist"s petition that arose out of a pure heart. God will not listen to the prayer of a person who nurses sin in his or her heart. He hears it, of course, because He knows all, but He will not hear it in the sense of answering it, under normal circumstances. The psalm closes with the psalmist"s personal benediction to God for granting his petition and bestowing His loyal love. [source][source][source]
When God"s people are in need they should purify their hearts and pray. When they do, He will answer and bless them. This should cause other people to honor and praise God. [source][source][source]