What does Psalm 30:1 mean?
The description of this psalm is usually translated with the phrase "the dedication of the temple." Other versions translate this as "the dedication of the house." The Hebrew terms translated as "temple" include the term ba'yit, used here, as well as hekal', which has a more formal meaning. David did not live to see the temple built in Jerusalem (1 Kings 8:17–19), though his son Solomon did (2 Samuel 7:12–13; 1 Kings 7:51; 8:1–66). This psalm might be something David wrote to dedicate the future site of the temple (1 Chronicles 22:1; 2 Chronicles 3:1). That's likely why this psalm includes references to God's forgiveness. David's dedication of the temple site came shortly after he angered God through an unapproved census (1 Chronicles 21:7–14).David vows to praise God for "drawing him up." This pictures the Lord pulling David from danger and away from death. Psalm 71:20 echoes this by stating: "You who have made me see many troubles and calamities will revive me again; from the depths of the earth you will bring me up again." David's brush with God's wrath, due to his census, is likely the danger from which he was spared (1 Chronicles 21:7–13). Judgment there came in the form of a pestilence or plague. Though this was terrible, it was an alternative to something worse. David could have been conquered by his enemies, letting them "rejoice over" his defeat.
An alternative explanation is that David experienced personal illness. Or, that the plague which struck Israel made him deathly ill. Even if that was the case, there should be no misunderstanding that sickness is always the result of sin—it is not (John 9:1–3). The apostle Paul writes in Philippians 2:25–30 about a severe illness Epaphroditus experienced. He was a fervent servant of the Lord, therefore there is no reason to suspect his illness was related to sin in his life. However, the Lord can use sickness to humble a disobedient believer—or an entire nation—to inspire repentance. This seems to have been the case with David.