One way could be to focus on the positive aspects the character brought to the story. It helps shift the focus from the sadness of their death.
Well, you could think about how the character's life and actions had meaning and influenced the story. Maybe even re-read or re-watch the parts where they were alive to remember the good times. And give yourself some time to process the emotions, it's normal to feel sad.