Psalm 37's title says it is By David. It reads like an older person's advice. David says, I have been young, and now am old. His main theme is how to live when evil people seem to do well. He begins, Don't fret because of evildoers, neither be envious against those who work unrighteousness. For they shall soon be cut down like the grass, and wither like the green herb. Their success is like grass that dries up.
Instead of fretting, David gives commands. Trust in Yahweh, and do good. Delight yourself in Yahweh, and he will give you the desires of your heart. Commit your way to Yahweh. Trust also in him, and he will do this: he will make your righteousness shine out like light. Rest in Yahweh, and wait patiently for him. Cease from anger, and forsake wrath. Don't fret; it leads only to evildoing. The humble shall inherit the land. In the New Testament, Jesus echoes this: Blessed are the gentle, for they shall inherit the earth (Matthew 5:5).
David knows the wicked can be dangerous. They draw the sword and bend the bow against the poor, but their own weapons will be broken. He saw the wicked in great power, spreading like a green tree, but he passed away, and could not be found. Meanwhile, A man's steps are established by Yahweh. Though he stumble, he shall not fall, for Yahweh holds him up with his hand. I have not seen the righteous forsaken, nor his children begging for bread. The salvation of the righteous is from Yahweh. He is their stronghold in the time of trouble.