Jeremiah Burroughs helps us to think about righteous responses to God in times of affliction. I have used and referred to this section often:
…where contentment of heart springs from grace, the heart is very quick and lively in the service of God. Yea, the more any gracious heart can bring itself to be in contented disposition, the more fit it is for any service of God. It is very active and lively, not dull, in the service of God. And just as a contented heart is very active and busy in the work of God, so he is very active and busy in sanctifying God’s name in the affliction that befalls him.
The difference is very clear: The one whose disposition is quiet is not disquieted as others are, but neither does he show any activeness of spirit to sanctify the name of God in his affliction. But, on the other hand, he whose contentment is of grace is not diquieted and keeps his heart quiet with regard to vexation and trouble, and at the same time is not dull or heavy but very active to sanctify God’s name in the affliction he is experiencing. For if a man is to be free from discontent and worry it is not enough merely not to murmur but you must be active in sanctifying God’s name in the affliction.…That is the main thing that brings quietness of heart and helps against discontent in a gracious heart. I say, the desire and care your soul has to sanctify God’s name in an affliction is what quietens the soul, and this is what others lack. [my emphasis]