It always pains me to see movies where someone's loved one dies, and the survivor's pastor, -when asked, "Why did God do this?" - will, with a sad expression, give some nonsensical reply, like: "Gawd works in mysterious ways. It was His will that your baby/spouse/brother/sister/ whoever died from AIDS/COVID-19/Rubella/a rapid-growing cancer ... or was killed in that awful, horrible accident/fell off a cliff/was burned to death in a horrific house fire/hanged him/herself ......"
It makes me want to shout, "OH, SHUT UP, YOU DUMMY! God didn't 'do this' to your loved one! The answer is: "We live in a fallen world, where bad things happen. Nobody is exempt, including innocent little babies who haven't even had a chance to 'sin' yet"...
My goodness - where do supposed "pastors" come up with those lame answers they supply? Scripture TELLS us why bad things happen:
We inherited our sinfulness from Adam and Eve in the Garden of Eden (Genesis 3) and since then, God has constantly reached out to "fallen man" to show us how to become reconciled to Him via His Torah, which perfectly outlines HOW to live holy and set apart lives.
My goodness - He even sent us His Divine Son, Yeshua, who martyred Himself on our behalf, to make it easy on us to become reconciled to God, merely by "believing" in him!
Truth is, there no easy answer as to why God allows "bad things to happen to good people!" But we CAN know that YHWH does some of His best work in and through "broken vessels" - those who have suffered pain and loss and grown stronger in their faith BECAUSE of their suffering. (Psalm 51:17; Isaiah 57:15; Proverbs 3:5-6, etc.)
We must learn to recognize that "bad times" are part of our growing process. We cannot truly understand "good times" UNLESS we've suffered through "bad times."
Borrowing from an old Oak Ridge Boys' song: "Where the sun always shines, there's a desert below."...
Borrowing from the BIble:
2 Corinthians12:9. And he said to me, “My grace is sufficient for you; for my power is perfected in weakness.” Gladly, therefore, will I glory in my infirmities, that the power of the Mashiyach may rest upon me. 10. Therefore I have pleasure in infirmities, in reproach, in afflictions, in persecutions, in distresses, which are for the Mashiyach’s sake: for when I am weak, then am I strong. (AENT)