It is sad, but I've been practicing gratitude and acceptance. It's really helped.
I the case of my parents, the worst has happened, but I'm still here and I'm still happy! The thing I was most scared of has been and gone and I survived.
I use the serenity prayer a lot. You might already know it:
Grant me the serenity to accept the things I cannot change,
The courage to change the things I can
And the wisdom to know the difference
I just repeated it (either out loud or silently) every time a negative thought entered my head.
And I wrote gratitude lists. When mum died I was truly grateful for the people who supported me (family, friends, medics, carers, hospice nurses), the fact that I was able to care for her at home for those two precious weeks, the fact that she didn't suffer too long, the fact that we'd loved each other and nothing was left unsaid, even just a sunny day - there was always something for my list.
God, I must sound so preachy! Sorry.