A few observations from Psalm 119:
God’s painful discipline of his children always has a redemptive purpose and is done in faithful love. 67 Before I was afflicted I went astray, but now I keep your word. 71 It is good for me that I was afflicted, that I might learn your statutes. 75 I know, O Lord, that your rules are righteous, and that in faithfulness you have afflicted me.
God’s word sustains us through affliction. 92 If your law had not been my delight, I would have perished in my affliction.