When you're debating a topic with someone, it's in your best interest to avoid flat-out telling someone they're wrong. All it does is make the other person defensive, causing them to entrench themselves further in their beliefs. Instead, tell them all the ways they're right, then guide them to realising they're wrong on their own.
This approach to persuasive debate goes all the way back to the 17th century philosopher Blaise Pascal. He found that the best way to change someone's mind was to see things from their perspective, then enable them to change their own mind. Pascal writes in section 9 of Pensées:
"When we wish to correct with advantage, and to show another that he errs, we must notice from what side he views the matter, for on that side it is usually true, and admit that truth to him, but reveal to him the side on which it is false. He is satisfied with that, for he sees that he was not mistaken, and that he only failed to see all sides... People are generally better persuaded by the reasons which they have themselves discovered than by those which have come into the mind of others."
Put simply, if you want someone to realise they're wrong, start by showing them how they're right — then show them the things they may not be aware of. Provide them with information that will lead them to their own enlightenment and you'll avoid a heated argument. As Pascal explains, nobody gets offended by not being able to see every aspect of something. We're only human, right? But people will get offended when you tell them they're wrong because it feels like a personal attack on their character and intellect. Once you do that, your chance of cooperation goes out the window.
Arthur Markman, psychology professor at The University of Texas at Austin, tells Olivia Goldhill at Quartz that this philosophical take on rhetoric actually works quite well in the real world. As Markman puts it, you're giving someone the opportunity to lower their guard and permission to change their mind without fear of it making them look bad. Cooperation is back on the table, and intellectual discussion can thrive thanks to a sort of unspoken social transaction, like "I'll agree that you're right about this and give you some of my information, then you are free to admit you're wrong about that without any unnecessary chastisement." Sometimes changing someone's mind is about giving them the chance to do so.