Of course! Here’s a suggestion for a sympathetic message:
"Hi [Name], I just wanted to reach out and say how sorry I am for your loss. Please know that I’m here for you during this difficult time. If you need someone to talk to or anything at all, don’t hesitate to reach out. Take care of yourself."