Everyone's suffering is different.
Even if you've dealt with the exact same issue as your friend, the issue will affect you differently. So don't tell your friend empty platitudes like, "The same thing happened to me, and so I know how you must be feeling.”
Instead, give them space to process their feelings. Ask gentle questions, listen attentively, and don't rush them.
In the moment, your friend might not really know what they're feeling. Have you ever thought you were angry, but really you were embarassed? Or though you were sad, but really you were lonely? Emotions are complicated. It can take time for someone to sort through their feelings and figure out what's really going on. So don't rush your friend as they work through that process.
And don't tell them, “You must be angry” or, “You must be so miserable.” Instead, ask questions. “Did it make you angry when she said that?” is good, although it's not great because it's a leading question. “How did you feel when she said that?” is better.
Another option is to share how YOU would feel in that situation. For instance, you might say something like “Man, if my boyfriend cheated on me, I would be furious. How are you handling it?”
By sharing your own feelings, it can help your friend process their own feelings. They might realize “Yeah, I feel furious too” or “Actually, I don't feel furious – I feel relieved. I guess I'm glad the relationship is over.”
Most importantly, you should never tell them “get over it” or “pull yourself together.” As with a physical wound, emotional wounds take time to heal. An injured person can't make a broken bone heal faster through willpower, and a suffering person can't heal emotionally faster through willpower.
It takes time – don't rush them.