Recently, I had to watch my best friend go through a breakup. I'd seen her go through ones before, breakups from short relationships that weren't really going anywhere and long ones where she felt she would never heal after each. As a spectator to her heartache, I feel both helpless to be able to cure her pain and I feel empathetic to her pain, like I just went through a breakup myself. Watching someone you're so close to go through breakups never truly gets easier, but I've recently come to some realizations about what to do.
The main thing to do in this situation is to offer your company. Even if your friend doesn't think they need it or aren't exactly sure what they want, they will appreciate spending time with someone that they can either say nothing or everything to, and the friendship will still be strong. As a best friend, I know that I can sit around and do nothing with my BFF and be content, so whether you do something active or just chill, your effort to be around will be enjoyed.
You can also try to offer your own advice in this situation, and don't just focus solely on how terrible your friend's ex is. You should definitely acknowledge any problems the ex contributed to the relationship because that probably factored into the breakup. As a best friend though, you should feel secure enough in your friendship that you can tell it like is to your BFF about their behavior and what they can learn from for their next relationship. What you can also say is ideas about how to move on, how to acknowledge their ex as something that hurts them but also how to put their ex on the back burner after a time in order to focus their happiness. I told my friend that the timing and the distance were definitely factors in their breakup that would one day be overcome by a relationship she would have in the future.
The last important thing you want to do in this situation is let your BFF know that they are just as strong and awesome as they are without a significant other as they are with them. You should never make them feel like they don't deserve a healthy, happy relationship because many people do. You should remind them that their single status is not a bad place to be in and that working on themselves should be a priority, rather than rushing to find a new SO. Since my friend's breakup was recent, I'm going to continue to be there for support rather than push her to do things she doesn't want to do, and when she's ready, I'll be the same friend I've always been, hanging out with her and having her back.