I'm not aiming this at anyone in particular, but if you want to help someone who's having a bad time, especially who's depressed, try to find another way of helping instead of saying "is there anything I can do to help?"
That offer seems helpful but it means the person who is suffering now has a new task: finding you something to do.
Instead think of a way you can help and offer that.
It takes the burden onto yourself, and crucially it shows what level of help you actually mean.
@Loukas Isn't that kind of the point of the phrase, though? For true friends, we already know what they need and we just help. For the neighbor we've seen twice in the last year, we say "Let me know if there's anything I can do to help." knowing that it's largely a hollow offer.
@LouisIngenthron I don't like hollow offers.
@Loukas Me neither, but what else do you say? "Good luck with that"? We can't provide meaningful help to people we don't really know.
@LouisIngenthron sympathy is great, so express it in ways that aren't hollow offers please.