There are things you might tell yourself. For instance, consider what you would tell a friend in the same situation. I am sure you would be positive and encouraging. So give yourself the same pat on the back and words of encouragement. You are worth it.
I learnt about being resilient yesterday. The stand-out for me was finding and maintaining a Sense of Purpose. Gratitude is a component too.
This is fresh. Give yourself time to digest it. It sounds like you are in grief too. There are steps to recovering from this the biggest one being acceptance. Don't force this to happen though, allow time for this to set in first. Finally is there any chance you might be able to find some closure?
Good luck and remember to give yourself permission to be upset. Be gentle on yourself.