Advantage should not be applied in situations involving serious foul play, violent conduct or a second cautionable offence unless there is a clear opportunity to score a goal. The referee must send off the player when the ball is next out of play, but if the player plays the ball or challenges/interferes with an opponent, the referee will stop play, send off the player and restart with an indirect free kick, unless the player committed a more serious offence.
Good luck with the making an instant decision on the second Cautionable offence bit. I’ve been at games with upwards of 8 or 9 yellow cards and the referees can hardly keep track using their notebook never mind making an instant decision.