As the year comes to a close, and as President Trump’s foreign policy suddenly veers in the wrong direction with wild and ill-advised moves on Syria and Afghanistan, here’s a national security columnist’s wish list for 2019.

Foremost, the president must return to the instincts that convinced hawks like Trump’s golfing buddy Lindsey Graham, and many other GOP foreign policy types, that he is up to the job and capable of doing good in the world.

His allies as well as his constant critics panned the Syria decision. All pointed to a line in Secretary of Defense James Mattis’ resignation letter that urged “treating allies with respect and also being clear-eyed about both malign actors and strategic competitors.”

Yet it was Trump who imposed new sanctions on malign actor Iran. It was Trump who authorized the sale of arms to our ally Ukraine — to the chagrin of one strategic competitor, Russia. It was Trump who (for better or worse) launched a tariff war against another rival, China.

He also moved the US Embassy to Jerusalem, pleasing America’s closest ally, Israel, and bonded with the president of our strongest ally in the Pacific region, Shinzo Abe of Japan. Finally, it was Trump who punished the Syrian regime’s chemical atrocities with an airstrike (though he should have followed up).

True, relations with Europe’s ­ever-moralizing leaders chilled, but that alliance didn’t collapse, ­either. Meanwhile in this hemisphere, a rebranded NAFTA pact diffused tensions, and now Trump has a new ally in Brazil, a key South American player.

Alas, the decision to betray Kurds, Muslims and Christians who fought against ISIS alongside us has marred that promising start. Israeli defense officials are quietly seething. The winner is Turkish strongman Recep Tayyip Erdogan, who is in cahoots with Russia, Iran and Sunni extremists, and is cultivating regional anti-Americanism. Now Turkey is ready to smash our anti-ISIS allies.

Let’s hope, as Trump revamps his national security team, for quiet tweaks to the Syria decision (walking it back fully would be uncharacteristic). The goal: Reassure Kurds, help Israel intensify its campaign against Iranian entrenchment on its borders and forestall an ISIS resurgence.

Trump’s decision to pull out may have its reasons, but if so, in 2019 he must better explain them to Americans. Why, for example, cut US troops in Afghanistan by half with the aim of ending all involvement there? And why an immediate redeployment, rather than conditioning the announcements on significant progress?

Trumpians warn of “endless wars,” but today’s military campaigns can’t end in clear victories and perhaps they aren’t supposed to. They are more akin to lawn-mowing, uprooting global bad weeds on a regular basis. And remember: No mandatory draft or national mobilization is needed. Instead, these wars ­require patient, continuous attention with relatively small footprints.

A few other wishes: