Don't blame the other person instead of your partner
A big mistake we often make is blaming the person our partner cheated with instead of our actual partner. Keep the side chick/dude OUT of this. He or she had nothing to do with your partner cheating. The side piece wasn't the one cheating, your partner was.
The other person in this equation wasn't sleeping with your boyfriend or girlfriend to hurt you. Keep it together and give blame where blame is due.
Don't pretend you didn't do something crazy if you actually did
If things get out of control and you really are losing it, just remember this: This person cheated on you. They betrayed you. So who actually cares if you look crazy for a hot second?
Your partner may do whatever he or she can to make you look insane, but you already have multiple forms of evidence, right? He or she just wants to find any defense on hand; and tearing you down is the only one there is. Keep your cool if your soon-to-be-ex wants to get mad at you for going through their phone. Don't pretend you didn't do something crazy, if you did the crazy thing. If you went through their messages, just say so. It doesn't even matter anymore.