I'm thinking about the times that I have been in one of those gatherings of Christians--a small group that meets regularly or a church committee meeting or a Sunday School class--and the leader asks who will offer the opening prayer. Some times, somebody will volunteer immediately; some times, not.
On the other hand, sometimes, we are ready to pray immediately, even involuntarily. We're in a situation in which we automatically turn to God and we know what we need to say.
Psalm 54 is a prayer by someone who is in a dire enough situation that cannot be handled without help. This psalm begins with an imperative, "God! Save me by your name." Included within that imperative is the confidence that God can save me.
Verse 3 describes the specific need for the prayer, but the prayer itself can be prayed sincerely by all of us in all of our specific needs. After all, I am aware that God has helped me throughout my life (verse 4).
With that confidence based on recalling what God has already done, the psalmist shifts from plea to promise: "I will sacrifice to you. I will give thanks to your name, Lord."