(Image courtesy of https://obscurecharacters.files.wordpress.com/2016/10/job-wife11.jpg.)
"Be patient, therefore, brothers, until the coming of the Lord. See how the farmer waits for the precious fruit of the earth, being patient about it, until it receives the early and late rains. You also, be patient. Establish your hearts, for the coming of the Lord is at hand. Do not grumble against one another, brothers, so that you may not be judged; behold, the Judge is standing at the door. As an example of suffering and patience, brothers, take the prophets who spoke in the name of the Lord. Behold, we consider those blessed who remained steadfast. You have heard of the steadfastness of Job, and you have seen the purpose of the Lord, how the Lord is compassionate and merciful" (James 5:7-11).
I don't know why bad things have to happen, but I do know that God has a plan. That is the essence of faith: trusting God even when things don't make sense. It is trusting the Lord and not relying on our own understanding (Proverbs 3:5-6).