Psalm 21 is, in the first sense, a psalm of David. It confesses that though David is a king, he places his trust not in himself, but in God.
But we know David was not always trusting in God, and he abused his power as king especially with Bathsheba and Uriah. (2 Samuel 11)
In the second, more important sense this is about Jesus as our King. He truly put His trust in Our Father, submitting even to death, that in his crucifixion the steadfast love of God could be shown to the whole world.
Take a minute and read through all of Psalm 21 with Jesus in mind as our King.