Job was a good and righteous man who devoutly worshiped God, he had ten children, and was quite wealthy. One day Satan appeared before God in heaven and God asks him what he thinks about the righteous man Job? Satan replied that the only reason Job remained faithful was because God protected him from harm and heaped blessings on him. So if God were to remove his protective care over Job he'd curse God and lose his faith. God agrees and in one day Job loses all his possessions and children. Job is devastated. He shaves his hair, tears his clothes, and laments, "Naked I came into this world, and naked I'll return, the Lord gives and the Lord takes away, blessed is the name of the Lord!"
After all the misfortune that befell Job, Satan again appears in heaven and God asks him what he thinks of the righteous man Job? Satan replied that if Job were to lose his health then he'd curse God and lose his faith. After all, people will give up everything just to save themselves. So God agrees and Job loses his health. Job is pushed to utter dispair, and he sits on a pile of ashes and scrapes his painful sores. Unfortunately Job's wife, believing God to be unjust, offers no encouragement but tells Job to just "curse God and die!" But Job is undeterred and corrects her saying, "Should we receive the good that God gives and not the bad?"
Next Job's three friends hear about all his misfortune, and wanting to console him, they went and sat with Job in the ash heap for a week not saying a word. Finally Job speaks and in his deep despair curses the day he was ever born, but surprisingly he never curses God or accuses God of injustice towards him but rather he accepts his plight as God's will.
Instead of encouraging him, Job's friends suggest that Job's troubles were because God is punishing him for something he did wrong. Job doesn't buy these arguments because he knows deep down inside that he hasn't done anything wrong. He can't explain why all these bad things happened to him, but he continues to trust in God.
At last God interrupts their conversation and explains to them that people cannot comprehend God's plans or actions or why He allows bad things to happen to good people.
We all know that if we behave badly, we'll eventually reap the consequences. If we heavily smoke our whole lives and wind up with lung cancer or heart disease can we honestly blame the tobacco companies? Or if we drink heavily and get liver cirrhosis can we reasonably blame the bartender? If we run up huge debts, have our vehicles repossessed and lose our home to foreclosure, can we blame the bank for our financial troubles? If we cheat on our spouse and end up divorced can we blame them for the breakup? If we abuse our children can we blame them if they grow up to hate us? If we commit a serious crime and end up in prison can we blame the judge or jury?
But what if we're like Job and try our best to live good and decent lives yet bad things still happen to us, how do we make sense of that? Certainly Job nor his three friends couldn't. During Jesus' time, he gave us a clue about why bad things might happen to good people. He met a man who was blind from birth (John 9), and his disciples asked him, "Teacher, who sinned, this man or his parents, that he should be born blind?" Jesus answered them, "Neither this man nor his parents sinned; he was born blind that God's works might be revealed in him." Even in the book of Job there's a backstory we're told about a test of Job's faith that God allowed.
Our health fails and we're diagnosed with a chronic or terminal illness, and our prayers for a miracle cure go unanswered. Our spouse leaves us, and our prayers for a reconciliation are ignored. We lose our jobs and livelihoods, and our prayers for new employment go unanswered. God essentially says, "No!" or "Not Now!" to all our prayers for salvation. So what are we supposed to do? Do we stop praying? Do we stop trusting in God? Do we stop believing? Job would tell us, "Should we receive the good that God gives and not the bad?"
I wish I could tell you I have an answer for you, but like Job and his three friends I do not. Furthermore, many learned scholars have speculated but don't really know either. The only solace I can offer is that I believe there's a reason for everything that happens. (I know that sounds cliche, but I believe scripture and most religious scholars would support that assertion.) We probably won't know the reason in our lifetimes, but maybe we'll be told in the next and it'll all make sense to us then. Job's only response to all the bad things that happened to him was to keep on trusting God. I think that somehow deep inside him he knew that God was with him in all his struggles. So the big lesson we can take away from Job is not to lose hope or our faith in God when bad things happen to good people.