What should you do if two of your friends don't like each other much and talk bad about each other to you?

If you want to keep both friends, tell each of them that you don't want to talk or hear about the other and that you value the friendships you have with them.