My method of getting kids not to swear at camp was just to appeal to their sense of fairness.
Child: “Fuck!”
Me: “Hey! I’m not allowed to swear in front of you guys. It’s not fair if you swear in front of me, is it?”
Child: “I guess not… sorry…”
I literally always want to swear.