Pot calling the kettle black

The pot calling the kettle black is an informal fallacy also called Tu quoque. Another name is appeal to hypocrisy.

It happens when a person is guilty of the very thing of which they accuse another.

“ "Oho!" said the pot to the kettle;
"You are dirty and ugly and black!
Sure no one would think you were metal,
Except when you're given a crack".

"Not so! not so!" kettle said to the pot;
"'Tis your own dirty image you see;
For I am so clean – without blemish or blot –
That your blackness is mirrored in me".

”

A fable, perhaps by Aesop, has a mother crab and its young, where the mother tells the child to walk straight, and is asked in return to demonstrate how that is done.

A present-day example:

Peter: "It is morally wrong to use animals for food or clothing".
Bill: "But you are wearing a leather jacket and you have a roast beef sandwich in your hand! How can you say that using animals for food and clothing is wrong?"

It is a fallacy because a person's actions or character do not affect the logic of the argument.