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.
Examples
You say wasting water is harmful, but you left a tap open last week. So wasting water cannot be harmful.
You tell us to put phones away during meetings, but you checked yours yesterday. That proves the rule has no merit.