The first word of caution came Monday night from the man who once led the Democratic Party, as former president Barack Obama gently warned freshman Democrats to think carefully about the costs of their bold liberal proposals.

The next day, the current leader of the party, House Speaker Nancy Pelosi (Calif.), told her caucus in a closed-door meeting to refocus attention on ideas that won Democrats the majority in 2018, particularly ensuring health care for millions of Americans.

Taken together, the Democratic leaders past and present delivered a message of pragmatism as they sought to unify their party ahead of 2020 elections, focus on their legislative agenda and move past impeachment talk after a special counsel did not find a criminal conspiracy involving President Trump associates and Russia during the 2016 campaign. 

Trump, ironically, may have helped Democrats in that endeavor. The Justice Department’s decision Monday night to challenge the legality of the Affordable Care Act gave Democrats the opportunity to pivot to an issue that carried them to power in the House and highlight their new legislation protecting Americans with preexisting medical conditions. 

Pelosi could not have timed it better if she had made the decision herself, Democrats joked Tuesday — even as Trump tweeted that “the Republican Party will become ‘The Party of Healthcare!’ ”

“We must, with all that is going on, stay focused on our purpose ‘For the People’ — lower health-care costs, bigger paychecks and cleaner government,” Pelosi told her members during the private caucus meeting Tuesday morning, referring to the official name of the House Democrats’ 2018 campaign platform.  

House Democrats — many disappointed in Robert S. Mueller III’s findings on Trump — quickly fell in line. Investigations of the president were a limited topic of a policy-focused caucus meeting Tuesday. And moderate and liberal Democrats alike emerged talking about health care and fair pay.

Even liberal supporters of impeachment, including Rep. Maxine Waters (D-Calif.), who chairs the House Financial Services Committee, and Rep. Alexandria Ocasio-Cortez (N.Y.), argued that Democrats were focused on legislating and that impeachment was not a priority.

“I don’t think we should be running on the president; I think we need to be running on our agenda . . . on health care . . . on increasing people’s pay,” said Ocasio-Cortez, who said she supports impeachment but knows the Senate will never take it up. “Right now, in the short term, what we have control over is bringing bills to the floor that embody our values.”

There are, of course, some outliers. During Tuesday’s meeting, Rep. Rashida Tlaib (D-Mich.) stood and argued that Democrats need to continue investigating Trump. 

Tlaib had circulated a letter Monday night asking for co-sponsors for a resolution “to inquire whether President Trump committed impeachable offenses” on a number of issues, not just those included in the scope of the Mueller report.

When Tlaib mentioned her letter, the caucus instead moved quickly to discuss the policy to-do list.

On Monday night, Obama delivered his warning to freshmen at a private gathering away from the Capitol, telling them that even a liberal voter might shun a liberal policy if it means an increase in taxes. While Obama did not give specifics, people in the room took his remarks as a cautionary note about Medicare-for-all and the Green New Deal, two liberal ideas that have divided Democrats.

Earlier in the evening, House Democratic leaders’ urgency to stay on message peaked during a private leadership meeting. Two senior Democrats from opposite sides of the caucus — liberal Rep. David N. Cicilline (R.I.) and Rep. Cheri Bustos (Ill.), who represents a Republican-leaning district — argued that it was time for the Democratic Party to move away from Trump and Russian interference in the 2016 election. 

Bustos, the head of the House Democratic Congressional Campaign Committee, said voters in her district had complained that Democrats do not care about them. She said voters knew little about the legislation on which the party was working.

Democratic lawmakers needed to focus on policy, not Trump, Bustos said. Everyone agreed.

A few minutes later, when House Majority Leader Steny H. Hoyer (D-Md.) outlined top priorities for the week, Pelosi paused when he mentioned a proposal aimed at supporting transgender individuals in the military. Pelosi, who supports the proposal, said even that idea was off-message for a critical week in which Democrats had to show they were about more than pushing back against Trump, according to five people who were in the room. 

That proposal, after all, was a reaction to Trump’s ban on the recruitment of transgender people into the military. Rather, Pelosi said the leaders need to highlight economic initiatives, including their bill demanding equal pay for women, which will be voted on this week.

The individuals spoke on the condition of anonymity to freely comment on the discussions.

At one point during the meeting, freshman Rep. Katie Hill (Calif.) asked how members could make the media focus on legislation rather than controversies with the president. The overwhelming answer: You can’t. Just pivot, according to multiple people who were in the room.

The Trump administration’s actions against the ACA gave Democrats the chance to redirect their messaging. The Justice Department argued in a filing with the U.S. Court of Appeals for the 5th Circuit, where a case on the Obama health-care law is pending, that the entire law should be struck down. 

Tuesday afternoon, as he headed to Capitol Hill for a meeting with Senate Republicans, Trump asserted that his party would gain the upper hand on health care. But after Republicans tried to repeal the ACA in the previous Congress — including protections for people with preexisting conditions — the party lost more than 40 seats and Democrats claimed the House majority for the first time in nearly a decade.

That is why House Minority Leader Kevin McCarthy (R-Calif.), addressing heavy GOP losses during a private donor call this year, called health care “the defining issue and the most important issue in the race.” McCarthy, notably, declined to answer questions about the Justice Department’s position at a Tuesday news conference, referring questions to his office.

Beyond the ACA fight, House Budget Committee Chairman John Yarmuth (D-Ky.) said Sunday’s release of the summary of Mueller’s findings has also forced Democrats to refocus on their legislative agenda.

“That’s always been our priority, but I think now everybody feels it’s much more important that we show the American people that that’s what we’re doing rather than talking about it,” he said.

The summary of Mueller’s report released by Attorney General William P. Barr said that Mueller did not establish a criminal conspiracy between Trump and Russia during the 2016 presidential campaign while offering no conclusion on whether the president sought to obstruct justice during the investigation. Barr said he determined there was not sufficient evidence to bring an obstruction charge.

To be sure, the Russia and obstruction question is likely to come roaring back — and drown out carefully planned legislative messaging — if and when the Mueller report is released. Rep. Bill Pascrell Jr. (D-N.J.), who has led the push to force Trump to disclose his tax returns, said that even if Mueller did not find aconspiracy, Democrats had to keep investigating Trump.

“I think you’re going to see a very aggressive attempt to find out what really did happen,” he said, adding that Mueller “had a very narrow target” for his probe. Asked about the leadership’s attempt to pivot, Pascrell said, “We can walk and chew gum at the same time.”

Colby Itkowitz and Erica Werner contributed to this report.