GP post is right, but left out a detail. I have used this trick multiple times and it usually impressed people:
Scenario is wine with cork fully inside bottle. Take a long slender knife, stab through the center of the cork as far as possible. Twist and and pull, with very little pull and lots of twist. Cork comes out. The key here is that the pressure of twisting prevents most of the slippage that would happen if you just pulled the knife out.
Enjoy impressing friends/family.