At the risk of being reductionist; this is the same question every decent society asks, how to encourage people to behave with the minimum amount of energy.
Online is complicated by anonymity. And poisoned by the owners being grifters. It needs to be ground up, not top down.
Point of order! Anonymity is not a major driver of online abuse, and in fact, the most stable and least abusive configuration for a social site is "persistent pseudonyms", then "anonymity", then "mandatory identification using wallet names". theconversation.com/online-anony...
People behave so, so weirdly in groups, and one of the big problems about today's social media platforms is that a lot of the core assumptions for those platforms were set at a time before anyone realized just how much this is true.