I’ve straight up copy pasted that title from Maria here. I really enjoyed the blog post. I recommend reading all of it, but the tl;dr is this:
If you see someone go through a hard time, don’t feel sorry for them. It deprives them of agency. If you say you’re sorry, you’re saying they’re unable to deal with what is happening.
People are much wiser and stronger than we think. They have the power to use whatever challenge they’re facing as a tool for growth. The best you can do is to be their cheerleader. Say, I know it is hard, but I know you can make it.