You find the most malignant surgery prelim in West Bum****, Arkansas and hope they have an empty spot still. Or equivalent.
The people that have the most difficulty when this happens are neurology residents, because surgery prelims don't count for them. Only medicine does, and there's a lot fewer open medicine prelim spots than there are surgery.