Psalm 31:5 is a prayer of complete trust: "Into your hand I commit my spirit." David entrusts his life to the LORD, whom he calls the faithful God who has redeemed him. The words became a natural expression of confidence in God amid danger and uncertainty.
Luke 23:46 records Jesus speaking these words from the cross immediately before His death, adding the intimate address "Father." The connection is direct because Jesus quotes the psalm. His final words demonstrate that even in death He entrusts Himself willingly to the Father. What was originally David's prayer of confidence becomes, on Jesus' lips, a profound expression of obedient trust as He completes His earthly suffering.