I read this from a Tucker Max interview, the dude who was the most hated person on the internet at one point. It went something like:

When you feel affected by an online comment, it means you’re attaching a piece of your identity to it. The question is not how to deal with it superficially, but how and what to work on your life so you can stop attaching yourself to such things.

And I think that’s the best advice when it comes to dealing with haters.