This is a continuation of Psalm 142. In this occasion, David was forced to flee Jerusalem by his son Absalom. This is a Psalm of confession, with the desire to seek to do God’s will.
David implores God to hear him not because he merited a hearing, but on the basis of God’s own faithfulness and righteousness.
David looks back to God’s past faithfulness and he remembers God’s doing. He remembers all God had done because he meditates on them. What a powerful example for us. To meditate on God’s doing so we remember.
David’s spiritual honesty and attitude of self-introspection is what makes him bow before God and worship. David knew he could trust God’s faithfulness.