What if the extra player was “fouled”?
This is treated as misconduct by the player who did it. The extra player is cautioned and shown the yellow card and removed from the game. The player who “fouled” the extra player is given the appropriate punishment if the “foul” was either reckless (caution/yellow card for unsporting behavior) or involved the use of excessive force (send-off/red card for violent conduct). You restart the game with an indirect free kick for the team of the player who committed the misconduct at the place where the ball was when you stopped play. This is because the illegal entry by the “extra player” occurred first.