David wrote Psalm 18 after he won victory over the previous king of Israel, Saul.
I love you, Lord;
you are my strength.
2 The Lord is my rock, my fortress, and my savior;
my God is my rock, in whom I find protection.
He is my shield, the power that saves me,
and my place of safety.
3 I called on the Lord, who is worthy of praise,
and he saved me from my enemies.