It’s very normal to be stuck for words when you’re writing a letter of condolence or visiting someone who’s just suffered a bereavement. “I’m so sorry” seems to be all that comes to mind, but it feels inadequate. So here are a few suggestions to help you.
If you’re speaking to someone face-to-face or on the phone, don’t be afraid to talk about the person who’s just died. One very common comment from bereaved people is that their friends avoid the subject, no wanting to mention the deceased in case it upsets the bereaved. But usually the bereaved want to talk about the dead person: they want to remember, maybe let off steam, or relieve their anger at being left behind. After a sudden or tragic death these feelings will be even stronger, and may include guilt at surviving. These conversations may not be comfortable for you, but they will help your friend.
Whatever the circumstances, offer whatever help you can, whether that’s a long-distance Skype call, food for the freezer while they don’t feel like cooking or just someone to sit and chat to. Bereavement has strange effects on some people: feeling disconnected from the world around them, exhaustion, inability to think straight. A true friend is a lifeline at such times.