Battered, bruised and beaten, Donald Trump faces a grim reality. Halfway through his term, his presidency is at low tide.

The polls have cratered and his necessary retreat over using a shutdown to get wall funding had some erstwhile supporters spitting venom at him.

His usual tormentors, meanwhile, are riding high. Nancy Pelosi drew her first blood as speaker, Chuck Schumer kept Senate Dems in line and the anti-Trump media are celebrating the president’s pain.

EX-STARBUCKS CEO HOWARD SCHULTZ 'SERIOUSLY' MULLS PRESIDENTIAL RUN, BASHES TRUMP AS 'NOT QUALIFIED'

If that weren’t trouble enough, special counsel Robert Mueller is still scalp-hunting. His indictment of Roger Stone, while not dinging Trump directly, keeps the Russia, Russia, Russia pot boiling and gives House Dems more grist for their pile-on probes.

It doesn’t help that, ethics-wise, Stone now joins Paul Manafort and Michael Cohen in giving Trump’s former circle a resemblance to the freakish bar scene in “Star Wars.”

Still, Trump is not the first president to put himself behind the eight ball. Sooner or later, they all do.

The challenge now is a clear-eyed acceptance of reality and laser-like focus on the key question: What is my presidency for?

It’s not a metaphysical quiz. The goal is to separate fact from fantasy and see what remains possible in light of the national mood and the 2020 calendar.

What Trump cares about most, and what he should devote the rest of his presidency to, is obvious: fixing the immigration crisis, with border security the essential first step.

In large measure, it is why he ran and why he was elected. It is the heart of America First.

That’s not to say he should jettison the hunt for better trade deals and the end of North Korean nukes, although foreign governments, knowing Trump’s predicament, will raise the price on any agreements.

But he, like all presidents, will rise or fall on domestic issues, and legislative victories at home are now impossible. Pelosi and Schumer are afraid of their party’s radicals, so the safest path for them always will be “no.”

While that leaves Trump little room to maneuver, it paradoxically points the only way forward. Because there is nothing he can do to please the half of the country that hates him, he must do everything he can to win back those who were with him until the shutdown dragged on.

The longest in history, it cost him about 10 points in the polls. I believe most of those people can be won back if he stays the course on border ­security while expanding the focus beyond the wall and violent crime.

Especially during the three-week window for negotiations, Trump must get out of Washington and explain to the public the long-term cultural and financial stakes of porous borders.

Especially during the three-week window for negotiations, Trump must get out of Washington and explain to the public the long-term cultural and financial stakes of porous borders.

He made a start in the Rose Garden Friday, saying barriers not only keep drugs and criminals out, they also “save good people from attempting a very dangerous journey from other countries — thousands of miles — because they think they have a glimmer of hope of coming through.”

He talked of better technology and “desperately needed humanitarian assistance for those being exploited and abused by coyotes, smugglers, and the dangerous journey north.”

And he made sense by noting that the numbers are so vast — 60,000 apprehended in each of the last three months, he said — that “the tremendous economic and financial burdens of illegal immigration fall on the shoulders of low-income Americans.”

All true, and there is much more to say about the corrosive effect illegal immigration has on American life, especially the promise that we are a nation of laws. Sadly, that claim is becoming null and void.

Large numbers are crossing illegally each day, with patrol agents in Arizona saying that one group that tunneled under a fence included 376 people, nearly 200 of them under age 18.

All 376 applied for asylum, and after being processed, were scattered across America.

ABC News interviewed several in the group from Guatemala, including a man who said he paid $5,000 to coyotes and that it took him and his 12-year-old daughter eight days to get to the border. They had a plane ticket for San Diego.

Nearby, a mother and two daughters were going to Cincinnati. They also said they spent eight days traveling, mostly on buses.

They will join the 800,000 already waiting for asylum hearings, a backlog that grows by the day. Most will never show up for hearings, and few who skip will ever be arrested unless they commit a federal felony. They arrived in America illegally, and will join millions living in the shadows.

Yet for most, that life will be far better than life in the hellhole ­nations they fled, especially now as Democrats aim to erase distinctions between legal and illegal ­immigrants.

Sanctuary cities offer free health care and reduced college tuitions and many blue states give all comers the right to driver’s licenses. There are also efforts to allow illegal immigrants to vote in local elections.

Pelosi and Schumer, who in the past voted for the walls they now denounce, deny they support open borders, but their refusal to support barriers is nearly the same thing. With the border nearly 2,000 miles long, barriers are essential at many points.

Trump can say all this day after day in city after city, and it might change nothing. So be it. He still has, as he said again Saturday, the avenue of declaring an emergency and using other funds.

CLICK HERE TO GET THE FOX NEWS APP

He also could work with private groups trying to raise money through contributions. Kris Kobach, the former Kansas secretary of state, is advising one group, “We Build the Wall,’’ and he told The New York Times the president gave the project his blessing.

No one can know what, if anything, will gain Trump a second term. But sometimes the key to winning is behaving as if there is something worse than losing. In Trump’s case, that would be giving up on securing the border and failing to put America first.

Click here to keep reading Michael Goodwin's column in the New York Post.