It's a somewhat archaic expression, but it paints a vivid image of someone destroying something valuable, like a precious goose, by cooking it.
Here are a few examples:
* "He cooked his own goose when he missed the deadline on that important project."
* "By constantly arguing with the boss, she cooked her own goose and ended up getting fired."
The idiom emphasizes that the negative outcome is self-inflicted and often a result of poor judgment or recklessness.