Okay, imagine you have a toy train with a battery in it. The battery spins a little motor that makes the train move. But how does the battery know which way to spin the motor? That's where the commutator comes in!
The commutator is a special part inside the motor that looks like a little cylinder with some metal bars sticking out of it. The metal bars are called brushes. The commutator spins around inside the motor and the brushes touch it to make an electrical connection between the battery and the motor.
But here's the tricky part: the commutator has to switch the connection between the battery and the motor as it spins around. That's because the motor has an electromagnet inside it that has to switch poles (like North and South) very quickly to keep the train moving. If the commutator didn't switch the connections, the electromagnet would get stuck and the train wouldn't move!
So the commutator switches the connections between the battery and the motor very quickly, so the electromagnet can keep switching poles and keep the train moving. And that's how the toy train (and lots of other things with electric motors) work!