This is the last of the nineteen Sonnets on this cycle. Although published in 1633, Many date them earlier. From Infogalactic:
Many of the poems are believed to have been written in 1609 and 1610, during a period of great personal distress and strife for Donne who suffered a combination of physical, emotional, and financial hardships during this time. This was also a time of personal religious turmoil as Donne was in the process of conversion from Roman Catholicism to Anglicanism, and would take holy orders in 1615 despite profound reluctance and significant self-doubt about becoming a priest. Sonnet XVII (“Since she whom I loved hath paid her last debt”) is thought to have been written in 1617 following the death of his wife Anne Moore
The wars, strifes and passions of this time did not leave Donne immune. He was quite aware of his failings. Like the sinner in the temple, he is praying for mercy, not reciting his qualifications as the Pharisees — then and now — are in the habit of doing.
Donne’s struggles are ours. And our best days are when we are aware of the holiness of God, and the unworthiness of our lives.
Oh, to vex me, contraries meet in one:
Inconstancy unnaturally hath begot
A constant habit; that when I would not
I change in vows, and in devotion.
As humorous is my contrition
As my profane love, and as soon forgot:
As riddlingly distempered, cold and hot,
As praying, as mute; as infinite, as none.
I durst not view heaven yesterday; and today
In prayers and flattering speeches I court God:
Tomorrow I quake with true fear of his rod.
So my devout fits come and go away
Like a fantastic ague; save that here
Those are my best days, when I shake with feare.
It’s worth noting that these were circulated before his death, but not published until he was gone, a bit like the Terrible Sonnets of that convert to Catholicism from the Anglican Church, Gerard Manley Hopkins. Too many people run away from such. As if doubt, fear, and despair are not emotions of the human condition, and not causes of salvation or damnation.