How do you not lose faith after losing a loved one?

I do not consider myself very religious, however I have a family friend who is a born again Christian. He is a pastor, and his family has dedicated their life to Jesus.

He has 3 children and they are all very, very active in the church. However last night, his daughter passed away at 35 years old from cancer (after beating it once). I just don’t understand how they can still have faith after this? I would feel so betrayed after dedicating my whole life, just to have my daughter taken away at such a young age

I feel terrible for this family. They did not deserve this. Completely heartbroken