A vague offer of help, many people will never make use of. "If there's anything I can do..." often doesn't quite signal "if there's _anything_" so much as a concrete offer of the time, effort, or money you're willing to put in to help out. Even if it's not quite what will help them, you've signalled you're e.g. willing to spend 8 hours and $1000. It's a lot easier to ask for something else, comparable, and know it's within reason. Otherwise, most people won't impose on you for anything major.
I'd edit to: “Hey, I heard about the news. I don’t have the right words and please don’t feel obligated to reply. Just know that if I can do something, big or small, now or in the future, I'd be glad to. For example, I'd be glad to ____ or ____. If you'd like to talk, I'm a phone call away, or I'd be glad to bring dinner over tomorrow, if you'd like to chat.”
Much of this has a cultural component too. Some of the above might be too much in the US and too little in more collectivist cultures.