If this life were the beginning and the end of our existence, it would be difficult to see how God could be merciful and yet allow such catastrophes to happen. However, this life is not the end. In fact, it isn't even the beginning. We lived with God before we chose to come to earth. We knew what trials and heartache we would have to endure, but we so wanted to become like our Father that we trusted His explanation that this schooling would be necessary if we were to reach that goal.
Some exit the school of life seemingly early. But these, like all of us, simply move on to further education. The great Teacher knows who is ready to move on, who is needed in the next life, and who would ultimately benefit from enduring the trial of the death of a loved one. Death is not the catastrophe we make it out to be, because death is temporary. Extremely difficult, yes. Heartbreaking, true. But the disconsolation can pass. We will have opportunity to lived with our loved ones again, this time for eternity if we've done well in school--if we've become what we came here to learn to become.