It's a difficult problem. You will need a backend service, an account system to provide logins, a reporting system that feeds in to that, a system to ban or otherwise moderate accounts that violate the moderation policy, and people to keep reviewing it regularly.
By far the easiest solution is to not allow players to do anything that could violate a moderation policy. This is why many games auto-assign usernames and avatars, or only allow choosing between combinations of pre-set values, and only provide pre-set messages for player chat.