Refuge in God and My Spirit Committed into His Hand
David asks never to be put to shame, calls God rock and fortress, and entrusts his spirit into God’s hand. In the psalm, this is a prayer of total self-entrustment in danger: the faithful God is asked to redeem and preserve the speaker.
Luke 23:46 records Jesus using Psalm 31:5 as his final prayer from the cross: “Father, into thy hands I commend my spirit.” That is an explicit Jesus-use of the Psalm and belongs in the highest-confidence category. Jesus adopts Israel’s prayer of trust at the moment of death.