Remind your child, “when you’re with people you don't know online, don’t type” to use a general rule. This is to steer your child away from sharing any personal information that they may be asked by others.
There is no way to filter certain content or language. Remind your child that if they see anything inappropriate while playing with others that they should speak to you or another trusted adult about it. It won’t mean that they can’t play anymore but they can get help with blocking whoever has behaved inappropriately.