Job prayed. He was described by God himself as blameless and upright. And God allowed everything to be stripped from him while heaven watched. Job's friends offered theological explanations — you must have sinned, God is disciplining you, there's something you're not confessing. Job rejected every one of them, not because he was arrogant but because he knew they were wrong. The book of Job exists in Scripture partly to demolish the idea that unanswered prayer is always the result of personal failure.
Psalm 88 is the only lament psalm that ends without resolution. No "but I will trust in you," no turn toward praise. It ends: "darkness is my closest friend." Heman wrote it. It's in the canon. God preserved it. The existence of Psalm 88 in Scripture means that God does not require you to perform hopefulness you don't feel. That psalm is prayer. The expression of abandonment is itself addressed to God.
Habakkuk opens with "O LORD, how long shall I cry, and thou wilt not hear?" This is not a backslider. This is a prophet. He prays, nothing changes, he complains about the silence, and God eventually answers — but not immediately, and not with an explanation. He answers with "write the vision, wait for it." The waiting is part of the answer, not the failure of prayer.
Commentary is from a charismatic Protestant perspective, drawing on KJV text and public-domain sources including Spurgeon, Andrew Murray, and Matthew Henry.