“If you find yourself in a hole, just stop digging.”
William Rogers - The first law of holes.

(The first law of holes, or the law of holes, is an adage which states that "if you find yourself in a hole, stop digging". Digging a hole makes it deeper and therefore harder to get back out, which is used as a metaphor that when in an untenable position, it is best to stop carrying on and exacerbating the situation.)