Psalm 31

Psalm 31
Psalm 31 was used by the Lord at the end of His suffering on the cross (verse 5; Luke 23:4646And when Jesus had cried with a loud voice, he said, Father, into thy hands I commend my spirit: and having said thus, he gave up the ghost. (Luke 23:46)), but we could not say that all of the psalm applied to Him; it could not be true of Him that is said in verses 9 to 12, for example. It is another prayer of the godly Jews in the coming day. To God they look for deliverance in an outpouring of heart that shows great depth of suffering.
In verse 19 the subject is no longer myself and my troubles, but the goodness of God laid up for them that fear Him, and which He has wrought for those that trust in Him.
Verse 20 seems to look on to the time when the godly Jews would have to flee from Jerusalem to be cared for by God, after the pattern of Elijah in 1 Kings 17. (See Matthew 24:1616Then let them which be in Judea flee into the mountains: (Matthew 24:16) and following).
The closing verses encourage the faithful to love the Lord; He preserves them; let their heart take courage, for their hope will be brought to pass. The night of weeping will soon be past, and the unclouded morning appear.