Read Job 2:3-10.

A Tested Man
"So went Satan forth from the presence of the Lord,
and smote Job with sore boils from the sole of his foot unto his crown" (v. 7).

Sometimes, life doesn’t seem fair! Job has lost his wealth and children, and now God has allowed Satan to attack Job physically. Let’s look closely and see what nuggets of wisdom we can find in this passage today.
God knows what is going on in Job’s life, yet He allows it: painful boils, coupled with the scorn and anger of his wife's rejection, leave Job struggling for relief. Some scholars suggest one of Job’s trials was that Job’s wife was spared. Instead of comforting and ministering to him through his trials, she chose to find fault and tell him to curse God and die. Look at Job’s response to her. Job understood God is sovereign. When his wife scorned him and challenged his belief in God, Job responded courteously, realizing she was also grieving. Job extended to her both compassion and truth. Job's response to affliction demonstrated his faith and spiritual integrity. (LeeAnn Davison)
In the midst of tribulation, stand by me;
in the midst of tribulation, stand by me.
When the hosts of hell assail, and my strength begins to fail,
thou who never lost a battle, stand by me. (stand by me)
--- Charles Albert Tindley

God often chooses to allow things we cannot understand for reasons of His own.