I think, when we get news we don't want to hear, we tend to wonder why, or look for an explanation. Science offers explanations, but in the end, nothing happens that doesn't pass through God for approval first.
I believe God creates little souls in heaven, and He gives us all the individual characteristics He wants us to have. He "knits us together in our mother's womb." He decides what color our hair and eyes will be, chooses if we'll tend to be roly-poly or thin, if we'll be genius material, or creative, or practical... He gives us all our strengths and all our weaknesses, as well as the things He wants us to change and overcome. The Bible says when He creates us, He numbers our days as well. Some of us get many days, some, not so many.
When the time comes to put that little soul on the earth, I do not believe he randomly selects the little soul and then randomly selects a family to receive it. I think He, in His infinite wisdom, very carefully selects the family for each of His creations. Sometimes we may feel cheated at His decisions, but can later look back and see how we were blessed and changed as a result. Sometimes we feel ill-equipped for the task He charges us with, but can later look back and see how God was there with us every step of the way, and changed our lives by teaching us to rely on Him.
Sometimes it's hard to go forward by faith. But all you can do is take one day at a time, and ask God for what you need, and be open to the ways that He'll be there.