God promised to raise up David’s offspring after him and establish his kingdom. God said, “Your house and your kingdom shall be made sure forever,” and that David’s throne would be established forever. See 2 Samuel 7:12–16.
In 2 Samuel 7:12–16 God promises David that after David dies, a descendant from his own body will rise to kingship. That son will build a “house” for God’s name, and God will make that king’s rule secure. This unit sits in Nathan’s message to David after David expresses a desire to build a permanent house (temple) for God (earlier in chapter 7). The message reverses the initiative: David will not be the builder; instead, God will “build” David a house in the sense of an enduring family line and dynasty.
This promise comes as a reversal of David’s plan to build God a “house.” In these verses, God is the main actor: he will raise up David’s own offspring after David’s death, establish that king’s rule, and secure David’s “house/kingdom/throne” with repeated language of “forever” (verses 12–13, 16).
A careful answer keeps the immediate passage, the book's argument, and the whole-Bible storyline together, so the question is answered in context instead of as a detached idea.
Start with 2 Samuel 7:12-16, then read the surrounding section so the answer stays connected to the passage's flow.
12When your days are fulfilled, and you shall sleep with your fathers, I will set up your seed after you, who shall proceed out of your bowels, and I will establish his kingdom.
13He shall build a house for my name, and I will establish the throne of his kingdom forever.
14I will be his father, and he shall be my son: if he commit iniquity, I will chasten him with the rod of men, and with the stripes of the children of men;
15but my lovingkindness shall not depart from him, as I took it from Saul, whom I put away before you.
16Your house and your kingdom shall be made sure for ever before you: your throne shall be established forever.