"Yet you are holy, enthroned on the praises of Israel."
Psalm 22 starts out with a cry for help. It is the same cry Jesus called out before he breathed his last on the cross. "My God, My God, why have you forsaken me?" These words have been a mystery to scholars for centuries. Did God temporarily abandon Christ on the cross? But if you realize what Jesus was quoting, you realize that his last words were song lyrics. Reread Psalm 22 as if it were Jesus speaking on the cross and you will understand why he started to recite this song, why he started to sing.
It is because the LORD, the LORD, the holy God of Israel, is enthroned on the praises of his people. The King James translates that he inhabits the praises of his people. God is made king by praise and worship. It is while we are in worship that God is most present to us for he inhabits our praises. Jesus sang God's praises, and his Father was right there with him as he lay dying. As Jesus sang, he knew God would deliver him.
And in your times of trouble, praise God all the more. When you are weak, praise God. If you are near death, praise God. No matter what your situation is, praise God, and he will be given all authority in your situation. He will inhabit your praise and he will be with you until the very end of the age.