"Just as God has used David's prayer of confession and repentance of his adultery in Pslam 51 to minister to His people down through the centuries, so God has used Job's struggles with doubt about the goodness of God to minister to His people.
Though we don't want to be critical of Job, we do want to learn from him about the sinfulness of asking a demanding 'why?' of God.
But though we should never ask a demanding 'why?' we may and should ask God to enable us to understand what He may be teaching us through a particular experience. But even here we must be careful that we are not seeking to satisfy our souls by finding some spiritual 'good' in the adversity. Rather we must trust God that He is working in the experience for our good, even when we see no beneficial results. We must learn to trust God when He doesn't tell us why, when we don't understand what He is doing."
--Jerry Bridges, Trusting God
For my thoughts are not your thoughts, nor are your ways my ways, says the Lord. For as the heavens are higher than the earth, so are my ways higher than your ways and my thoughts than your thoughts.
We know that all things work together for good for those who love God, who are called according to his purpose.