Often as not, government service is thankless work. For Gary Cohn, the latest adviser to President Donald Trump to announce his departure, it was especially so.

Cohn’s initial decision to join the administration as director of the National Economic Council was hardly a self-interested one. As a registered Democrat, he had little in common with Trump ideologically. As a top banker, he didn’t need the job. He surely didn’t relish the chaos, infighting and ambient legal jeopardy that came with the position.

Yet for more than a year, Cohn served the country well. He imposed order on Trump’s economic agenda and helped professionalize an inexperienced team. He tried to contain the economic eccentrics who seem to wander the White House halls. Many of the administration’s better ideas — improving bank regulation, privatizing air-traffic control, rethinking infrastructure spending — featured Cohn’s fingerprints.

For his trouble, Cohn was condemned by right and left, derided alternately as a globalist and a reactionary, while being subjected daily to his boss’s stultifying rhetoric and the administration’s chronic dysfunction.

“Many people wanting the job,” Trump tweeted, not so persuasively, after Cohn’s departure. “Will choose wisely!” For the sake of the economy, the country must hope so.

Most immediately, Cohn’s replacement will need to prevent (or at least mitigate) a seemingly imminent trade war. Trump’s heedless plan to tax steel and aluminum imports was one reason Cohn resigned. The president is still toying with dismantling NAFTA, undermining the World Trade Organization and repudiating valuable trade deals around the world.

These are all bad ideas. They will cost jobs, punish consumers, undermine alliances and invite retaliation, potentially on a significant scale.

Advancing Trump’s broader economic agenda, meanwhile, will be a challenge for any adviser, especially with elections looming, deficits widening and interest rates rising. It will be all the more so given that the best and brightest are not exactly knocking down the doors to this White House, and that the president has other, rather more delicate, matters to attend to.

Choose wisely, indeed.