Step 1: Understand the idiom.
The idiom bury the hatchet means to end a quarrel or disagreement and become friendly again.
Step 2: Interpret the sentence.
The sentence says that both parties agreed to bury the hatchet and work towards a common goal. This clearly indicates that they decided to settle their differences and cooperate peacefully.
Step 3: Analyse the options.
• (A) sign a formal agreement -- Incorrect. A formal agreement may follow peace, but it is not the meaning of the idiom.
• (B) end a conflict and make peace -- Correct. It exactly expresses the meaning of the idiom.
• (C) withdraw from a deal -- Incorrect. It means leaving an agreement, which is unrelated.
• (D) accept defeat gracefully -- Incorrect. The idiom is about reconciliation, not defeat.
Step 4: Final conclusion.
\[
\boxed{\text{Bury the hatchet}=\text{end a conflict and make peace}}
\]
Hence, the correct option is \(\boxed{(B)}\).