Passage
Now it happened when the king inhabited his house, and Yahweh had given him rest on every side from all his enemies,
Now it happened when the king inhabited his house, and Yahweh had given him rest on every side from all his enemies,
2 Samuel 7:1 Now it happened when the king inhabited his house, and Yahweh had given him rest on every side from all his enemies,
2 Samuel 7:2 that the king said to Nathan the prophet, “See now, I inhabit a house of cedar, but the ark of God inhabits tent curtains.”
2 Samuel 7:3 So Nathan said to the king, “Go, do all that is in your heart, for Yahweh is with you.”
The verse centers on "happened", "king", "inhabited", "house", "yahweh", "given", "rest", and "side". It is saying that the verse draws attention to "happened" and "king", so its meaning should be read from those terms before moving to application.
The next verse adds "that the king said to Nathan the...", so "happened" and "king" 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 "happened" and "king" with trust shaped by these words, not by a vague optimism outside the passage.