The referee may punish a player or substitute's misconduct by a caution (yellow card) or sending-off (red card). A second yellow card at the same game leads to a red card, and therefore to a sending-off.
If a player has been sent-off, no substitute can be brought on in their place. Misconduct may occur at any time, and while the offences that constitute misconduct are listed, the definitions are broad.