It obviously depends a lot on your relationship with them but what people usually need at times like this is to know you care, that they aren’t alone, and that you are there to help if needed.
It’s also important to give them the option to opt out of anything you offer and allow them space.
Something like ‘I know this must be a really hard time for you, you’ve been in my thoughts. Please let me know if there is anything I can do to help you out or even just talk’ then leave it at that unless they want to talk or need help. It acknowledges their grief, offers help, but crucially doesn’t make an obligation for them.
This is a genuinely difficult situation to deal with, nothing wrong with asking for advice.