the main pieces that i had to truly understand in order to recognize and stop most online arguing were:
1) performativeness. if the person responding to you is performing for other readers rather than having a genuine good-faith discussion with you, just move on. i still catch myself being performative sometimes and it grosses me out when i recognize it lol.
2) real world vs online behaviors. if someone is an asshole in the real world, we just wouldnt talk to them. not sure how we've convinced ourselves that online is different. if someone refuses to take the time to respond in a socially normal way, then why would you take the time to respond? if they wont take the time to be social, why would you?
little ass kids learn this shit in like kindergarten. if someone is a dick, no one is friends with them. if my friends and i are in a bar and some random is being an asshole, we dont "debate" them, we move on. again, tiny children learn this shit lol.
3) real people whose opinions you care about. make a list. when i did it, it turned out to be less than 20. the people on your list are the only people you should feel any obligation towards. not randoms on the internet. dont spend your valuable time/energy/mental arguing with random internet assholes. your list of real people are the only ones you should feel any obligation towards because if you value them, they likely value you opinions as well.
4) good faith. you'll know in one or two responses if the person replying is there in good-faith. if they're not, move on.
5) knowledge peers. its ok to recognize that someone is not on the same knowledge level as you in a topic. whether they know more or know less, either way, its ok. if we're lucky we are experts in one or two topics and dipshits in most topics. accept that fact. i know this is tough in our industry, we are overflowing with people who think they're smarter than they are. its ok to recognize that the other person is not your knowledge peer on the topic and adjust accordingly: up, down, or out.
6) conversation vs debate. if someone doesnt recognize there is a vast difference between normal conversation and debate, dont waste your time. honestly, they're typically gross to engage with.
and of course, find real world hobbies. once you have the hobby, it naturally becomes "why would i argue with this dickbag online when i could be doing something way more fun."