The ad hominem (Latin for, “to the person”) fallacy is attacking the person rather than the argument, by saying that the person must be wrong due to the group they belong to, the motivations for holding the position, whom they associate with, etc. An argument is an ad hominem when one of these categories is brought up to discredit an unrelated claim.
Now for a few examples: “You’re only an atheist because you don’t want to be held accountable for your lifestyle.” It may be true that an atheist doesn’t want to live by religious rules; but that neither proves nor disproves the existence of God.
“People only oppose political correctness and identity politics because they want to maintain white supremacy.” This may be true, and there are racist things said in the name of being “politically incorrect”, but a person’s motivations do not necessarily mean that the case they make is invalid, or mean that there is nothing wrong with PC culture.
Sometimes the ad hominem fallacy is used to attack an argument based on whom the speaker associates with. A personal example: a coworker once went on about a conspiracy theorist who went on bashing Mandela. When I pointed out alternative interpretations, he accused me of only supporting Mandela because I’m black. However, even if that were true, that says nothing about his claims about Mandela.
Similarly, this fallacy is committed when the speaker is disnissed as a libtard, a SJW, etc. This may be true, but merely being conservative, liberal, or a SJW does not make an argument right or wrong.
This is closely related to the genetic fallacy, rejecting something due to the source. For example, Pythagoras, the namesake of the Pythagorean Theorem, belonged to a number-worshipping cult. It would be the genetic fallacy to dismiss the Pythagorean Theorem because you don’t believe in worshipping numbers. Another example is rejecting an idea because you hear it on a news source you don’t agree with (Fox, the so-called liberal media, etc.).
The last category I’ll talk about is the tu quoque(Latin for “you too”) fallacy. Examples of this include Radovan Karadžić’s claim, during his trial for war crimes and crimes against humanity, that Croats and Bosniaks also committed war crimes. This may be true, but it doesn’t mean that Srebrenica wasn’t a genocide. Also, in response to references to racism, some white people make reference to “reverse racism”. Even if you accept the existence of reverse racism, it’s existence doesn’t mean that black people don’t face that white people don’t.
The bottom line is, in a discussion, focus on what your interlocutor is saying, the argument, and respond to that. Remember, debates are searches for the truth, not games to be won. The point is to learn more, and to connect across tribal lines. What matters is what the argument is, and what is most supported by what we know, and recognition that we don’t know everything.
It’s like the Golden Rule says, “Do unto others as you would have them do unto you.” It’s a good way to stand for truth and principles while also keeping an open mind and being tolerant. Avoiding the ad hominem helps build bridges, and helps one to have more accurate views.