David Returns to Gladness and Joy
Psalm 30:11 (ESV) … “You have turned for me my mourning into dancing; you have loosed my sackcloth and clothed me with gladness...”
As David had been brought, as it were, from the grave to the life-giving air, he promises to extol the name of God. It is God who lifts us up with his own hand when we have been plunged into a profound gulf; and therefore it is our duty, on our part, to sing his praises with our tongues.
David concludes the psalm as he had begun it, with thanksgiving. He affirms that it was by the help and blessing of God that he had escaped safe; and he then adds, that the final object of his escape was, that he might employ the rest of his life in celebrating the praises of God. Moreover, he shows us that he was not insensible or obdurate under his afflictions, but mourned in heaviness and sorrow; and he also shows that his very mourning had been the means of leading him to pray to God to deprecate his wrath. Both these points are most worthy of our observation, in order, first, that we may not suppose that the saints are guilty of stoical insensibility, depriving them of all feeling of grief; and, secondly, that we may perceive that in their mourning they were exercised to repentance.
This latter he denotes by the term sackcloth. It was a common practice among the ancients to clothe themselves with sackcloth when mourning, for no other reason, indeed, than that like guilty criminals, they might approach their heavenly Judge, imploring his forgiveness with all humility, and testifying by this clothing their humiliation and dissatisfaction with themselves.2 We know also that the orientals were addicted beyond all others to ceremonies. We perceive, therefore, that David, although he patiently submitted himself to God, was not free from grief. We also see that his sorrow was “after a godly sort,” as Paul speaks, (2 Cor. 7:10;) for to testify his penitence he clothed himself with sackcloth. By the term dancing, he does not mean any wanton or profane leaping, but a sober and holy exhibition of joy like that which sacred Scripture mentions when David conveyed the ark of the covenant to its place, (2 Sam. 6:16.)
If we may conjecture, however, we may gather from this, that the great danger of which David speaks in this psalm is by some improperly restricted to sickness, as it was very improbable that he would put on sackcloth when he was confined to a sick-bed. This, indeed, would not be a sufficient reason of itself, but in a doubtful case, as this is, it is not destitute of force. David therefore means, that, laying aside his mourning apparel, he returned from a state of heaviness and sorrow to joy; and this he ascribes to the grace of God alone, asserting that he had been his deliverer.
 Calvin, J., & Anderson, J. (2010). Commentary on the Book of Psalms (Vol. 1, pp. 495–497). Bellingham, WA: Logos Bible Software.