Where someone attempts to invalidate anything that’s problematic to their narrative and/or would trigger cognitive dissonance. Conspiracy theorists do this a lot, but so do your garden-variety bigot: when you’re outed as a drug addict, anyone can literally accuse you of anything, because no matter what you say or how stupid the accusation is, “junkies will do or say anything for dope,” “well of course junkies lie,” and “maybe you don’t remember because you were tweaking hard.”
You’re describing two separate problems there.
Attacking the person rather than their argument (“you would say that”, “you‘re a junkie”) is ad hominem, with its various subtypes.
As has already been pointed out, being selective about what you accept on the basis of pre-existing beliefs, cherry picking only what fits, is confirmation bias.
Although it may give onlookers a greater sense that you are the one who knows what they’re talking about, if you’re just trying to win an argument with someone like this, knowing either of these things is unlikely to be helpful. They’ll dismiss that as easily as anything else.