The first line of defence, in the war against trolls, is a complete lack of humour and a very thin skin. Everyone online is an unknown quantity and a lot of cruelty is disguised as banter, so the safest thing is to treat everything with suspicion, take offence, fiercely reject.
The very substance of being, online, is words. There, identities are constructed, intended. Words are the only currency and apparent sincerity is the only way of measuring their value: the closest you’ll ever get to truth is something that sounds like truth.
This means other people can define you completely, if their words about you sound more convincing, or even just tell a better story, than yours. They can own you. Your identity is putty in their hands, unless you push back. Silence, disdaining to respond, can seem like admission.
So, if you feel threatened, you need to establish that your words have greater sincerity than your opponent’s, that you mean them more. The best way to do that is to accuse them of not truly following the egalitarian principles of the internet. They are heretics, unbelievers disguised as the devout and you have unmasked them. They are PREJUDICED!
While you are one of the elect: a victimised minority, speaking out at last, reclaiming your birth-rights, terrible in your righteous indignation.
 You don’t have prior knowledge of your interlocutor, or non-verbal cues such as tone of voice, body language, facial expression, behaviour of their companions, dress. No smile or amiable, sympathetic look softens the hardness of their words.