"You are good and what you do is good; ..." (Psalms 119:68).
Since God is good, what He does is good - even allowing us to go through affliction (vv.67, 71).
Then, what is God's good will in our affliction?
It is for us to have "good judgment" (v.66).
It is for us to "learn" God's commands (v.71).
It is for us to know that our good God is doing good to us (v.65).