2 Samuel 22:7
In my distress I called upon the LORD, and cried to my God: and he did hear my voice out of his temple, and my cry did enter into his ears. In my distress I called upon the LORD, and cried to my God: and he did hear my voice out of his temple, and my cry did enter into his ears.
This verse belongs to a song David composed while Saul was hunting him to take his life. In that setting of pursuit and mortal danger, David set down his distress and his deliverance in a psalm of praise to God as his merciful preserver.
In his distress David called upon the Lord and cried out to his God. That calling and crying was an expression of his trust in God while in distress. God heard David's voice out of His temple, and David's cry entered into His ears.
The surrounding song recounts David's dangers and his deliverances from them. It praises God as his merciful preserver. In this way it stands as David's testimony to God's goodness, mercy, love, and watchful care, and to God's power to help him.