Hammer out (something) hammer (something) out

To make an agreement or plan by discussion and debate.

The union and managers were able to hammer out an agreement before midnight last night.