Shoot oneself in the foot

To make a mistake or a stupid decision that makes a situation worse.

The man shot himself in the foot when he refused to work extra to help his boss with the new project.