It's a hard question I doubt there's any Christian who's not asked, a number of times. The Lord's ways are not our ways, His view the eternal and spiritual things having most weight, His wisdom often beyond our comprehension, beyond our very ability to see, here in the flesh, we seeing through the glass darkly. What it all came down to with Job is to fear God, absolutely trust in God, despite our own understandings, and this the beginning of wisdom. That, at least, has also been my experience with the hardest lessons of life I've not understood, and can say, in any instance, I've emerged more spiritually focused. And, after all, our purpose is to be ready for our life hidden in Christ, in glory, this world not our home.