credit to EL_Radical
The true answer is “it depends”. Each community may be slightly different.
The main thing is that there is no state that holds a monopoly on power. This reenforces the idea that anarchism probably won’t come about from a quick revolution. It needs to be built over time and with trust and the understanding that we must work together.
An answer would be that the community uses some combination of restorative justice, therapy, arbitration, or in the worst cases exile or violence towards the offender.
It would be worth reading more about criminal justice on theanarchistlibrary.org.