Since Nafta came into effect in 1994, trilateral trade has quadrupled and investment across the continent has surged. Supply chains created by relatively high-cost producers in the United States and Canada and lower-cost producers in Mexico have enhanced the competitiveness of North American companies. Nafta has enabled Mexico to export products, not only people, a major United States and Mexican objective.

Nafta has been a net benefit for all three countries. Rapid technological change and significantly expanded trade with China have had a far greater impact on the working people of Mr. Trump’s base than Nafta.

Still, Nafta, which predates the smartphone era, needs modernizing. Electronic commerce is not covered by the agreement. Enhanced regulatory cooperation would improve productivity. And modern labor rights and environmental policies would update the agreement and enhance its appeal.

The Trump administration has three choices: walk away from Nafta altogether, which is what many Canadians think is the administration’s lightly disguised objective; insist on its onerous proposals in the hope that Canada or Mexico will accept the unacceptable or themselves abandon the talks; or negotiate in good faith for outcomes that benefit all parties.

Washington’s agreement last month to extend the negotiations until March is a hopeful sign. The Canadian government has made clear that it won’t abandon the talks even if they have to be kicked down the road past the 2018 Mexican presidential election and the midterm congressional elections in the United States. Canada will not provoke the Trump administration, but it also won’t fold under pressure.

If Nafta were to be abrogated, it would be costly for the Americans. Resentment of the United States by its major trading partners would mount, and cooperation across the board would suffer. Tariffs would be reimposed on United States imports and exports. Manufacturing jobs would be jeopardized in many of the states that elected Mr. Trump president. Global supply chains would be disrupted, making American (and Canadian and Mexican) industry less competitive with European and Asian companies.

Canada will take every opportunity to cooperate, but it will also adapt to life with a highly mercantilist neighbor. Canada will probably diversify trading partners, and double down on agreements with the European Union and the nascent 11-member Trans-Pacific Partnership. Further bilateral trade agreements will be forged with Japan and China, which is very interested in Canadian resources. Canada will partner with Mexico while waiting for the day that Washington is ready to rejoin its friends.

Congress has the constitutional power to regulate commerce with foreign nations. Better for congressional leaders to exercise that power now to prevent harm than to use it later to pick up the pieces after an entirely avoidable collapse of Nafta.