David really wanted to build the temple to God but God said because he was involved in so many wars, because he had killed so many people, that he was not the right person to build the temple, the house of the Lord. Instead, God promises David that he would have a son and that son would reign over Israel and his reign would be marked by peace. In Hebrew the word for peace is Shalom, and the son’s name was Solomon, which is Hebrew is Shelomon. Solomon would provide peace throughout the kingdom.
An offshoot of this peace that has come about because David has consolidated the kingdom and his reign is as far as anyone could have ever imagined, is that Solomon does not have to go into battle and can focus and concentrate on building the house of the Lord, which is the temple. David did a lot of the background work and provides vessels and other things, craftsmen etc. in order to equip the temple exactly as it ought to be. It gets better as we move forward.