How do you get over the sudden loss of a pet

I just can't wrap my head around having a seemingly perfectly healthy pet one minute, and then having die the next. Literally just like that. No warning, no chance to do anything. I just don't get it. I don't understand and I keep trying to find reason but I just can't.