How can I make a team randomizer?

Hey developers, I’ve tried searching for this before, but I’ve been unsuccessful in finding exactly what I want. What I am trying to achieve is making a team randomizer which sorts players into 2 or more teams, I’ve seen techniques before where they divide the amount of players by the amount of teams there are, but the problem with this is let’s say you had 11 players, you would end up with 5.5 players on each team, but you can’t have half a player, and if we were to round it down with math.floor, we would end up with 5 on each side, but then one is left out, etc etc.

Is there are a reliable technique to do this?