Sen. Bernie Sanders of Vermont spoke for many of his fellow Democratic presidential candidates last week when he answered a question about the best way to respond when President Trump says something “crazy racist.”

Should Democrats respond and risk turning the campaign into a referendum on race and white identity politics? Or should they pivot quickly to their economic message?

“I mean, who the hell knows?” Sanders said on the Pod Save America podcast. “You cannot ignore Donald Trump and his tweets and his lies. But if you become obsessed with them, I guarantee you will lose the election.”

Twenty Democratic candidates will try to solve that puzzle, onstage and under pressure, when they gather Tuesday and Wednesday in Detroit for their second debate. The event will unfold against the backdrop of incendiary tweets by Trump targeting prominent Americans of color, saying one is racist, one “hates Whites,” and another group should “go back” to their countries, among other things.

Party strategists focused on winning the general election next year have issued public warnings not to fall into Trump’s trap. They argue that approaching him as Hillary Clinton did in 2016, with a focus on his offensive behavior, could doom the party to another defeat, since voters want to hear about issues affecting their daily lives. But they also say the party cannot ignore the racial comments, given their emotional impact on large groups of Americans.

“Our message is not, ‘Don’t talk about immigration’ or ‘Don’t talk about race.’ That’s ridiculous. It’s important. We should talk about it,” said Guy Cecil, the chairman of Priorities USA, an outside group that plans to spend more than $100 million to defeat Trump. “It’s just that we have to be a lot more intentional about talking about the economy if we’re ever going to get people to pay attention to it.”

So, the candidates are groping to find a middle ground. They acknowledge, condemn and then seek to quickly move beyond Trump’s provocations to discuss bread-and-butter issues such as wages and health care. In many cases, candidates have cast themselves as political analysts to accomplish the shift, citing an array of issues they say the president is trying to obscure with his tactics.

“The reason that he is doing this is yet again to distract from the fact that he is trying to take health care away from people,” Sen. Kamala D. Harris of California told reporters Monday in Detroit. “Distract from the fact that he is putting babies in cages in the border, distract from the fact that he is conducting trade policy by tweet, and the very real possibility that hundreds of autoworkers may be out of their job by the end of the year and that farmers are looking at bankruptcy.”

Former San Antonio mayor Julián Castro, another presidential hopeful, went so far as to cite psychology and political science scholarship to explain Trump’s tweets in an appearance on CBS’s “Face the Nation” on Sunday.

“He engages in what’s known as ‘racial priming,’ ” Castro said. “Basically, using this language and taking actions to try to get people to move into their camps by racial and ethnic identity. That’s how he thinks he won in 2016, and that’s how he thinks he’s going to win in 2020.”

Whatever the merits of such analyses, Trump has managed to dominate attention in recent weeks with his provocative comments, forcing Democrats to scramble and making it harder for them to stay on message at a moment when they’re trying to prove themselves to voters.

In three weeks, the president has told four nonwhite congresswomen to “go back” to their ancestral countries, said “no human being” would want to live in the “rat and rodent infested” Baltimore district of another black congressman, Rep. Elijah E. Cummings, and accused Al Sharpton, a Democratic power broker from New York, of hating “whites and cops.”

Each of those outbursts has dominated news coverage, all but blotting out Democratic attempts to shift the national conversation with new policy proposals — a trade platform from Sen. Elizabeth Warren of Massachusetts, an environmental justice proposal from Washington Gov. Jay Inslee, a rural policy from former vice president Joe Biden and a new health-care approach from Harris, to name a few.

Much of the coverage of the Democratic field in the run-up to the debates, instead, has revolved around their condemnations of Trump as a “racist.” Some have gone further. Former congressman Beto O’Rourke of Texas has compared the president’s administration to the Third Reich, and compared Trump’s supporters, who chanted “Send her back!” at a recent rally, to the mobs of Nazis who gathered in Nuremberg, Germany.

“He should go home,” Biden said, after Trump tweeted that the four congresswomen, who are U.S. citizens, should go “back” to the other countries. “He should go home.”

Democratic leaders point to the 2018 midterm election results as evidence that Trump’s nativist and racially divisive appeals can be blunted. During that contest, Democratic House candidates stuck to a narrow message about health-care costs, wage growth and corruption in Washington. Trump countered by sounding a strident alarm about groups of migrants attempting to cross the southern border.

“His distraction of 2018 was ‘caravans.’ The distraction of 2020 will be to attempt to divide this nation around racial lines, and that is not going to work,” Democratic National Committee Chairman Tom Perez said Sunday on MSNBC. “This is about distracting the American people from the task at hand.”

Exit polls in 2018 found that 41 percent of voters picked health care as the most important issue facing the country, compared to 23 percent who chose immigration and 22 percent who picked the economy. When asked which party would better protect insurance coverage for people with preexisting medical conditions, 57 percent of voters chose Democrats while 35 percent chose Republicans.

Health care has continued to top American concerns in 2019. A Gallup poll in March found that 55 percent of Americans worry a great deal about the availability and affordability of health care, more than any other issue. Concern over federal spending and the budget deficit came in second, with half of Americans saying they had a great deal of concern about it.

On Monday, Trump turned his fire on Sanders by resurfacing a 2015 quote from the senator from Vermont, who told the Baltimore Sun that the city was like “a Third World country” after touring some of its most impoverished neighborhoods.

Sanders responded by threading the needle, much as his colleagues have been doing. He condemned Trump’s comments before pivoting to an economic message: a focus on the struggles of America’s working men and women, which he says Democrats should have embraced more fully in 2016.

“Trump’s lies and racism never end,” Sanders wrote on Twitter. “While I have been fighting to lift the people of Baltimore and elsewhere out of poverty with good paying jobs, housing and health care, he has been attacking workers and the poor.”