Based on Hebrew scripture.
Have you heard about Job? He had quite a story. You can find it in Hebrew scripture—the Book of Job.
Job lived in the land of Uz, and at the beginning, he was a happy man—as he should have been. He had ten great kids and a wonderful wife. He was wealthy, and he was a pious man. That meant he believed in God, prayed every day and gave thanks often for everything that he received. God seemed very pleased with him. "He's a great example," said God.
Then Satan came along and spoke to God. Satan said that Job loved God only because God was so good to Job. "I'll bet," said Satan, "that if Job's life turns bad, then Job will turn against you, God. Job will curse and complain."
"You are on," said God. He gave Satan permission to test Job any way he liked—as long as Job stayed alive.
That was enough for Satan. Soon messengers started bringing bad news to Job. Thieves had taken his donkeys and oxen. Fire had killed some sheep and servants.
Job did not understand. "Woe unto me if I am wicked," he said. But he felt innocent.
Job kept worshipping God. When he heard that a wind had destroyed a house and killed all ten of his children inside it, he fell to the ground and praised God. "Naked I came from my mother's womb," he said, "and naked shall I return there; God gave, and God has taken away; blessed be the name of God."
"Look at that," God said to Satan, but Satan was not done. Now it was time to destroy Job's health, and Satan did. Job got sores all over his body, bad dreams, peeling skin, and more.
Job's wife said he should curse God and die. But Job refused. He kept praising God.
Then three friends turned against him. It seemed they may have envied Job when everything was going well. Now they blamed him for his own suffering. "God is punishing you," they said. "Because you were not good."
Job might have wondered that himself. How was Job to know that God was testing him, not punishing him? In fact, God was really very impressed with Job. So when Job asked for answers, God finally spoke, in a voice that came out of a storm. Even though questioning God was possibly the first bad thing Job had ever done.
God asked Job a whole slew of big questions—about creation, about life, about much, much more. Job began to see how great God really was. God was much too great for Job to understand. "Sorry, God," he said. "I can never understand you." Or that's what he would have said, if he had spoken American English.
The Bible quotes Job like this. Job said to God (in Aramaic, maybe) "I know that you can do all things. No plan of yours can be thwarted... Surely I spoke of things I did not understand, things too wonderful for me to know... My ears had heard of you but now my eyes have seen you. Therefore I despise myself and repent in dust and ashes."
"That's okay," said God. "No problem." Or so God might have said in American English. But however God said it, God forgave Job for questioning him—only because Job had been so good, all along, and had passed Satan's test. God paused for a moment to scold Job's friends, and demanded a sacrifice from them for not being as good as Job. Then God turned back to Job and gave him great reward.
Job's new life was even better than before. He had more animals, and seven new sons and three new daughters. He lived happily for 140 more years, and he kept praising God through them all.