This section of verses records David's instructions to the people concerning how they could experience a full long life. This is didactic wisdom literature similar to what we find in the Book of Proverbs.
34:11 David addressed his people as a parent instructs his children. He promised wise counsel on the subject of trusting God.
34:12-14 God had promised long life to the godly in Israel as a reward for righteous behavior (cf. Exod. 20:12; Deut. 5:33). Therefore the psalmist urged truthful speech, good deeds, and peaceful conduct.
34:15-16 The righteous can look forward to the Lord's favor and His awareness of their needs, but the wicked can expect His antagonism and resistance.
34:17-18 God grants the petitions of the righteous when they pray for deliverance out of broken hearts.
34:19-21 The Lord also delivers the righteous out of his troubles. Keeping his bones from breaking (v. 20) expresses complete protection in spite of cruel opposition. The Apostle John used this verse in John 19:36 to describe God's care of His Son during His crucifixion.
34:22 This verse summarizes the reasons the godly should praise the Lord. This fact might not be clear from the content of the verse. We could understand it as another repetition of the thoughts expressed elsewhere in different terms. However in the Hebrew Bible this verse breaks the sequence of the acrostic structure of the psalm. It does not begin with the succeeding letter of the Hebrew alphabet as all the preceding verses do.87
Believers should be careful to give God praise for His salvation from our spiritual enemies. We should view instances of His deliverance as opportunities to urge ourselves and one another to continue to walk in the ways of righteousness faithfully.