On here, it just doesn't seem to happen anymore. I remember in the olden days though my policy was something akin to "slap them as hard as you can to make sure they know it's going to cost them". These days I would just put them on my ignore list, though. Life is way too short.
I remember when I used to play online games though. I really used to struggle sometimes there, those kids can be horrifying. I think now I wouldn't so much feel the need to stand up for myself there. The urge to defend yourself kinda stems from a place of being vulnerable to being hurt. I am still probably very vulnerable to being hurt, but I wouldn't feel the urge to defend myself, because I understand that. I would probably just do something else, tbh.
If you are letting this stuff affect you that badly, where it affects the rest of the day, know that you just gave them a massive amount of power over you. You just gave people on the internet, kids probably, the capacity to literally tank your mood. I don't say this to be critical, i understand how this can happen, but it really really isn't worth it.
Find a less toxic game or hobby.
You can work on your capacity to tolerate stuff like this, but is it really worth it? It's like voluntarily going into a prison, getting the **** kicked out of you, and then spending months building muscle and learning combat skills to go back into the prison to be able to defend yourself. At the end of the day, meh, just stop going in the prison