(Reposted here in full due to brevity; source.)
Here we have the Song of Assurance. Prayer works.
As the psalmist notes, genuine effective prayer requires a fully committed heart first, but the heart knows what to ask because the heart knows what God wants to do. And it is from the heart that we are loyal to the revelation of what God has appointed in Creation. So he cries out, ever renewing his personal covenant of loyalty, not calling on any other power. He knows that Jehovah is his salvation and the power to obey.
Even before dawn, his heart awakens him to spend time in the divine Presence. He cries out for the freedom that comes only from enslavement to God. He knows the precious promises of God’s Word. When something keeps him awake at night, when his soul is churning without sleep, he knows this is the call to ponder the revelation of Jehovah.
His experience thus far trusting in God has taught him that God is merciful when we call on Him, and that it is the nature of His justice to restore a vivid life. Such is the moral character of Jehovah. He makes a play on words: The wicked are too close to him and too far from God’s truth at the same time.
Yet God is also near at hand, in his own soul. With His divine Presence comes all of His truth burned into our souls. As he takes a fresh look at the record of God’s revelation, he recognizes that same ancient power that spoke to his heart long ago. So ancient and yet forever fresh is the Word of God.