I am assuming you are young still. Forgive if I’m wrong. I think it will take a long time before you will be at a place in life to understand that God had His hand on all of this. It really does work out for our betterment.
It took me many, many years before I understood and was able to see that my losses were really my gains. I have no words to explain this beyond just stating that as fact. Through much prayer and time, healing and clarity came into my heart. I was able to move past the why mes and see how blessed my family is. We have 13 personal saints to cheer us on our journey back home to heaven. That is so amazing!
I don’t expect you to understand this. You are not in a stage of life to even begin to ponder such things. Many people way smarter than me might be able to give you theological points to consider. All I can offer you is a voice of experience. And one that understands you may not yet be ready to hear with an open heart yet.
I hope God continues to bless your journey towards understanding, and that He leads you to exactly where He wants you in life.