It's a big problem without one simple solution. One thing we can do, though, is not enable it when possible. One big thing I have zeroed in on recently is comments.
When I redesigned my blog/website last year, I intentionally removed Disqus and all commenting ability. In fact, what prompted the redesign was that I wanted to add a box pleading with people to not use comments for tech support for various open source projects I've created and to file Github issues instead.
But the more I thought about it, the more I realized how bad comments have really gotten. Trolling, bullying, racism, sexism, homophobia, transphobia, abuse, and general mean behavior have become such a rampant problem that "don’t read the comments" has become an Internet meme on par with "don’t feel the trolls." Think about it: when was the last time that you changed your opinion because of a comment you read on a blog or news article? More than likely it just make you mad or made you sad.
I have been low-key nursing this idea for awhile now that the Internet would be better off if a lot of sites killed off comments. When comments become a breeding ground for the worst aspects of human behavior, why should we continue to enable it? Why should we host it and give it a voice? Why should we implicitly endorse it under our brand? Because that is what we do when we host comments.
Commenting should probably still exist on social media sites (Facebook, Reddit, HN, etc.) But most sites would be a lot better off if they just dropped comments entirely and reallocated those resources to more productive uses, and I think their users would be better off for it as well.
Yes, I am just one person with a small blog about programming. But if this is the position that I want to take, I should be the change that I want to see in the world. Thus, the removal of commenting. And I've been pushing this idea a bit in other areas that, just maybe, users don't need to be able to directly comment on things.