Senate Majority Leader Mitch McConnell (R-Ky.) speaks to reporters at the Capitol on Jan. 29, 2019. (J. Scott Applewhite/Associated Press)

DURING HIS first two years in office, President Trump’s aberrant impulses on foreign policy — toward pulling out of NATO, withdrawing U.S. troops from South Korea or cozying up to Vladi­mir Putin — were mostly restrained by the first team of senior aides he recruited. Then-Defense Secretary Jim Mattis, for example, repeatedly explained to the president why the Atlantic alliance is essential and how the presence of U.S. troops in Asia advances U.S. security.

Now Mr. Mattis, along with former national security adviser H.R. McMaster and former chief of staff John F. Kelly are gone, replaced by more pliant personalities — including an acting chief of staff and an acting defense secretary with no military experience. The danger that Mr. Trump will act on his uninformed and unreasonable prejudices has grown. It is more vital than ever that Congress, to the extent that it is able, check the president’s actions.

Fortunately, that is beginning to happen. In the past two months, the Senate and the House have passed resolutions or legislation that would impede Mr. Trump’s plans for withdrawing from Syria and Afghanistan, deter a pullout from South Korea or NATO, and end U.S. support for the disastrous Saudi-led intervention in Yemen. Unfortunately, most of the measures did not pass both chambers, but more bills are pending in the new Congress. They ought to advance with bipartisan support.

Perhaps the most significant vote was taken by the Senate last week on a resolution written by Majority Leader Mitch McConnell (R-Ky.), who rarely opposes Mr. Trump. The text warns that “the precipitous withdrawal of United States forces” from either Syria or Afghanistan “could put at risk hard-won gains and United States national security.” Forty-three Republican senators helped pass the measure by a lopsided 68-to-23 vote.

Last month, the House passed legislation that would ban Mr. Trump from using federal funds to withdraw from NATO by an even more one-sided vote of 357 to 22. And late last year, the Senate voted 56 to 41 to end U.S. involvement in the Yemen war, then unanimously approved a measure blaming Saudi Crown Prince Mohammed bin Salman for the death of journalist Jamal Khashoggi — a rejection of Mr. Trump’s refusal to hold the Saudi leader responsible.

Not surprisingly, Mr. Trump has tended to be publicly dismissive of these measures. During an interview broadcast by CBS on Sunday, he responded to a question about Mr. McConnell’s resolution by saying he “ran against 17 Republicans” and won while advocating withdrawal from the Middle East. But Mr. Trump has delayed the Syria withdrawal, which he originally ordered be completed in 30 days. And when he was asked about pulling troops from South Korea — another subject of past and pending congressional action — he claimed, falsely, that “I’ve never even discussed removing them.”

Congress must keep the pressure on. One vehicle could be bills introduced in the House last week by Reps. Tom Malinowski (D-N.J.) and Mike Gallagher (R-Wis.) that would restrict abrupt troop withdrawals from Syria and South Korea. Another is new bipartisan legislation to end U.S. aid for the Saudi campaign in Yemen, which has been introduced in both chambers. There is probably majority support for these measures; leaders should make them a priority.