If they have deemed the "nasty remark" to be dissent, then it is a caution, and the yellow card shown a second time. Then the player is dismissed for a second caution, and is shown the red card.
If they have deemed the remark to be offensive or insulting or abusive, then it is a dismissal, and...