What I actively try to do is realizing that everything is impermanent and could be gone the next day waking up.
This is the perfect mentality for this kinda situation. Thinking that nothing lasts forever makes you less relient on material things and when anything goes wrong with them, it doesn't get to you or get a better part of you.