Logical fallacy

Tu quoque (appeal to hypocrisy)

The speaker dismisses advice or criticism on the ground that the person offering it violates the same standard. Inconsistency in behavior does not settle whether the advice or criticism is correct.

A mirror reflecting a pointing finger back toward its owner

Examples

You say wasting water is harmful, but you left a tap open last week. So wasting water cannot be harmful.
Wasting water can be harmful even if the person pointing it out sometimes wastes it.
You tell us to put phones away during meetings, but you checked yours yesterday. That proves the rule has no merit.