Examples
StatementTagNote
She is a teacher,isn't she?positive, so negative tag
They have not finished,have they?negative, so positive tag
He plays cricket,doesn't he?no auxiliary, so *does* is added
You went there,didn't you?past simple takes *did*
He can swim,can't he?modal repeated

Repeat the auxiliary, reverse the polarity, and use a pronoun. Special cases: aren't I, shall we (let's), will you (command).

— Rule to remember

Key takeaways. Repeat the auxiliary, reverse the polarity, use a pronoun, and remember the special tags for I am, let's and there.