P.S. ....say 'David' or 'Sue' but you just sit with them.
Drop in from a little while with a Loaf of Bread or Fresh Milk....actions speak louder than any words can....No matter how simple the action is.
(I wrote a much longer answer...and it totally did not show up), just make sure
you don't say ''I know how you feel''....or ''It will be o.k.''...Just sit with them, let them do all the talking.That is the key here.
There probably isn't much you can say to someone to make it better. All you can really do is to be there if and when they need you. Help where you can with practicalities like buying some groceries or helping organise something that they need to get done so they can get through their grief.
Be transparent. Admit that you don't truly know how they feel but you are feeling the pain because they are going through a hard time. Let them know that you will be there to listen or just to be in their presence.
You don't have to say anything! Body language can be a deal breaker. Put yourself in their shoes as best you can, be genuine and heartfelt. So don't see them if you're not in the mood; they need you at your best and truest.
If you're on your phone a lot in front of them when you're supposed to be catching up or visiting to give support - do exactly that. Disconnect from your world and change the distraught person's world, even if for a few minutes. Lend an arm to lean on, leave them an unexpected meal such as dinner or dessert, and check up on them. Even just a hi, i've been thinking of you.