The more favorable implementations I have read about typically take the form of community patrol groups. Members of the group rotate in and out, and when something goes wrong they step in to de-escalate whatever situation is going on. For more serious problems, those boil down to a community wide decision on what to do with the perpetrators.
As for military, there's a few paths. In real life, the most ideal but least likely would be a world wide revolution that sees the end of hierarchy applied globally. At that point there would be no need for any military.
Next most likely would probably be a more dedicated form of the community patrol groups, with various populations pitching in with what they can and where they can.
Third is a geographical separation that leads to no need for a military. The best example of this is Annares in Ursula K. Le Guin's The Dispossessed. Annares and Urras are sister planets/moons. Annares is an anarchist utopia and Urras an archist nightmare. Theoretically any nation state on Urras could decide to wage war against Annares, but waging war against a different celestial body is much more difficult than a normal war, so in practice the threat of war is not very large, and therefore the need for military is absent.