Summary: An evangelistic sermon
1I waited patiently for the LORD; he inclined to me and heard my cry. 2He drew me up from the desolate pit, out of the miry bog, and set my feet upon a rock, making my steps secure. 3He put a new song in my mouth, a song of praise to our God. Many will see and fear, and put their trust in the LORD. 4Happy are those who make the LORD their trust, who do not turn to the proud, to those who go astray after false gods. 5You have multiplied, O LORD my God, your wondrous deeds and your thoughts toward us; none can compare with you. Were I to proclaim and tell of them, they would be more than can be counted.
6Sacrifice and offering you do not desire, but you have given me an open ear. Burnt offering and sin offering you have not required. 7Then I said, “Here I am; in the scroll of the book it is written of me. 8I delight to do your will, O my God; your law is within my heart.”
9I have told the glad news of deliverance in the great congregation; see, I have not restrained my lips, as you know, O LORD. 10I have not hidden your saving help within my heart, I have spoken of your faithfulness and your salvation; I have not concealed your steadfast love and your faithfulness from the great congregation. 11Do not, O LORD, withhold your mercy from me; let your steadfast love and your faithfulness keep me safe forever. Psalms 40:1 - 11 (NRSVA)
This Psalm is David’s; it is also about Jesus, and it’s about us!
David had gone through a period (perhaps several periods) of intense suffering. The “desolate pit” is literally the pit of howling, giving the word picture of a place of loneliness where the wind whips through, and the howling of lurking predators would send waves of fear through one’s mind.
The miry bog is “…the mud of corruption.” These are figurative expressions to point out the dreary, dismal, ruinous state of sin and guilt, and the utter inability of a condemned sinner to save himself either from the guilt of his conscience, or the corruption of his heart. 
David knew this condition. He had been a fugitive, hiding out in lonely, windy caves while King Saul pursued him hotly, wanting David’s head on a platter. Later David placed himself in a miry quicksand; a kind of spiritual death row as he committed adultery with Bathsheba, then conspired to commit murder to cover-up his wrongdoing.
David knew what it was like to be in a deep hole, separated from the God he once knew. This was David’s Psalm – a heart’s cry!
This was also a Psalm showing us that Jesus knew how it felt to have that howling lonely existence in the Garden of Gethsemane; the loneliness and weight of his task to pray for, suffer and die for all humanity surrounded Jesus and squeezed the sweat of great drops of blood from his body.
He knew the agony of separation from the Father on the cross as He cried, My God, why have you forsaken me?  This was a Psalm of Messiah. It’s David’s Psalm; it’s Jesus’ Psalm; and this is our Psalm too.
Do you doubt that it belongs to you? Have you never been afraid? Has it never been that the sound of howling waves of fear over some situation in your life has taken over; you sense that the muck of your life will drag you down until there is no memory at all of a better time? Have you never felt separated from God?
All of us have felt that separation, that hopelessness. You may not have messed-up as dramatically as David’s murder and adultery. But you have messed up! We’ve all messed up, and the winds of our sin howl through the horrible pit
Helplessness, hopelessness is the condition of man’s soul. It is our common predicament that sin creates literally for every human being, a pit of despair – a miry bog of quicksand that drags our soul down to hell.
Now, the social scientists have been attempting to convince us for decades that the pit (hell) and evil don’t exist. Our problems are simply the product of our environment, or at the worst, the sum of some unfortunate choices. If your mother dropped you on your head you have a lifetime exemption from responsibility for anything bad that happens.
The word on the psychiatric street is that there’s no such thing as sin, no such thing as the consequences of offending holy God. There is no right or wrong; there is only goodness and badness as we might choose to define those words, based upon the relative need we might or might not have at any moment in any given circumstance.