Ask yourself this question before you enter a serious debate with someone: is the person I am speaking to interested in their own mind, or in mine? The former might be worth talking to while the latter is not.
When you can tell that someone's priority is their own understanding, you can infer that they are likely more open-minded and serious about the topic. This is someone who may be willing to be proven wrong, and more likely will argue in good faith. By contrast, people who prioritize your opinions are motivated by a desire to win support for an agenda they are unwilling to question. It is the sign of a manipulator - an opponent who will likely engage in mendacity, logical fallacies, and whatever other tactics they deem necessary to get you to believe as they do.
Wise, confident people don't need the world to agree with them. They focus on their own values and ideas, and seek to align them with reality. The insecure person instead seeks to convert others to their ideological gang.
This isn't to say that you should never try to change others opinions. It is useful and sometimes necessary to be persuasive. If you are an activist, you necessarily have to think about the opinions of others in society. Still, it is important to never sacrifice your own intellectual integrity and to not waste your time. Use reason and honesty when you debate. Be willing to be wrong. Do not engage with those who argue in bad faith.