Passage
And David spoke to the Lord the words of this canticle, in the day that the Lord delivered him out of the hand of all his enemies, and out of the hand of Saul,
And David spoke to the Lord the words of this canticle, in the day that the Lord delivered him out of the hand of all his enemies, and out of the hand of Saul,
2 Samuel 22:1 And David spoke to the Lord the words of this canticle, in the day that the Lord delivered him out of the hand of all his enemies, and out of the hand of Saul,
2 Samuel 22:2 And he said: The Lord is my rock, and my strength, and my saviour.
2 Samuel 22:3 God is my strong one, in him will I trust: my shield, and the horn of my salvation: he lifteth me up, and is my refuge: my saviour, thou wilt deliver me from iniquity.
The verse centers on "david", "spoke", "lord", "words", "canticle", "delivered", and "hand". It is saying that the verse draws attention to "david" and "spoke", so its meaning should be read from those terms before moving to application.
The next verse adds "And he said The Lord is my...", so "david" and "spoke" should be read forward into that movement. In 2 Samuel context, the local focus is covenant, worship, and faithfulness.
A plain takeaway is to answer the verse's own emphasis on "david" and "spoke" with trust shaped by these words, not by a vague optimism outside the passage.