It’s not as if a code of conduct ever contains anything that sane people don’t already know.
And like some other commenter said, it basically boils down to “don’t be an asshole”.
Breaking the Code of Conduct isn't a one-and-done thing. You talk to that person, and tell them that what they said was over the line. Be that using a slur, being increasingly insulting to another community member, or something else.
I, as an administrator, basically tell them "not cool". If their reaction is "yeah, alright" then nothing more comes of it. No citations. No three-strike rules. But if someone continually defies our reprimands we have the backing of saying "you've repeatedly been told... " and "this is written in ..." meaning nothing should come as a surprise.
It's also a way for normal users to understand what might be rule-breaking behavior. I can't observe everything happening in a community, as much as I like participating in them. Instead, I have to rely on other non-admin members reporting bad behavior. Making it clear to other users what kind of behavior they can report someone for is also super helpful - and for some people induces trust.
"you repeatedly did x and this is explicitly against our Code of Conduct that you said you'd read before your first contribution"
instead of
"you're being a jerk and as such we will be refusing any contributions from you going forward".
The second example is completely arbitrary, and is up to the whims of the core team - whomever they might be. With a Code of Conduct you're (ideally) told up front what you can and cannot do. This reduces ambiguity and arbitrary decision making.
I can also tell you that a Code of Conduct isn't a change to how I personally govern the projects and communities I'm in charge of. Instead, it's about writing down what I would already remove people for anyway.