The death of someone can be tricky ground to walk on as anything yo say can trigger someone. If you knew the person who died personally, then you may want to share words of sympathy to their family and friends who cared about them. If the person dies in front of you, you may be lost for words at first, but after you will need to call for help to see why they died in the first place. If you did not know the person but their death happened near you, still try to call for help and comfort the people affected by the death till help arrives.
I'm so sad to hear about your loss
(someone) will be missed by many
(someone) was truly a wonderful person
I wish I could take away your pain
If there's anything I can do to help, please let me know
(someone) was such a shining light in so many people's lives
(someone) will be in our thoughts and prayers
(someone) was such a generous person
I wish I had the right words, just know I care
I don’t know how you feel, but I am here to help in any way I can
I am always just a phone call away
We all need help at times like this, I am here for you
There is a reason for everything
I wish you nothing but comfort and strength
I extend my deepest condolences to you during this dark time
I hope that the love and support from your family and friends, including me, gets you through this time
If you need anything, know that you’re not alone. I’m here for you
While there’s nothing I can do to change what happened, I can continue to offer you my love and support
Extending my most heartfelt condolences to you and your family
You have my deepest, sincerest sympathy
I am praying for you during this dark time
My sympathy is with you in your time of grieving
Cheer up. Your (someone) wouldn’t want you to be sad
(Someone) is in a better place
May all the sweet memories of (someone) bring you solace during this time
I hope and pray that you will have strength during this time of loss