Psalm 18 is a song of victory after David had conquered his enemies. The same song is also found in 2nd Samuel 22 with some variations. David had accomplished much and could have easily gotten arrogant and taken full credit for everything. But no matter how great the things he had done, David always knew where the credit was due. In the first three verses he shares his love for the Lord, he calls Him the rock and deliverer and exclaims that He is worthy to be praised.
David also had confidence that God was always with him. “For by you I can run against a troop, and by my God I can leap over a wall.” (Psalms 18:29) David made his share of mistakes and we will too, but like David we can have that same confidence in our Heavenly Father today if we follow His Word.