Someone was arguing with me on social media about Muawiyah and the others when he said Yazid and then "radi Allahu an" next to his name. I got so angry at the moment that I called him a Kafir and a nasibi on which he also called me a Kafir. Was what I did a good deed or a mistake?

You did not sin by saying that. Someone who praises Yazid is not a true Muslim. However, next time see if you can find a more effective way to show this person their mistake in praising Yazid.