U.S. President Donald Trump talks with Speaker of the House Nancy Pelosi as they walk down the U.S. Capitol steps on March 14, 2019.

The president and Pelosi have endured a rocky relationship in the months since the California Democrat started her second stint as House speaker. While they hoped to cooperate to overhaul U.S. infrastructure and slash prescription drug prices, they have managed to work together on little beyond the basic functions of keeping the government running.

The White House official also said, "We're trying to work with" Democrats on passing the United States-Mexico-Canada Agreement, or USMCA. Pelosi and members of her caucus have showed skepticism about ratifying Trump's replacement for NAFTA amid concerns about how it would affect labor and environmental protections, as well as pharmaceutical prices.

"But we will have to work with them on the spending matter. So there's a bunch of stuff we'll do. It's just the infrastructure," Mulvaney told CNBC's Eamon Javers at the Peter G. Peterson Foundation Fiscal Summit.

Still, he said Tuesday that President Donald Trump and House Speaker Nancy Pelosi will have to cooperate on pressing issues in the coming months — from passing a budget to approving trade agreements.

White House acting chief of staff Mick Mulvaney thinks efforts to strike an infrastructure deal with congressional Democrats are probably "done" after talks blew up last month.

Pelosi, meanwhile, has tried to balance a desire to investigate alleged misconduct in the Trump administration and the president's efforts to influence special counsel Robert Mueller's Russia investigation without sparking political backlash by pushing for Trump's impeachment. After reports that the speaker privately said she wanted to see the president in prison, Trump last week called Pelosi "nasty" and "vindictive."

At the Peterson Foundation summit earlier Tuesday, Pelosi said she was "done" with talking about Trump because he tries to shift attention away from more important issues.

"I just consider the source. My stock goes up every time he attacks me, so what can I say. But let's not spend too much time on that because that's his victory, the diverter-in-chief, the diverter-of-attention-in-chief," she said when asked about Trump's attacks on her.

The president contended Tuesday that Democrats "waste time" on investigations instead of focusing on issues such as immigration, lower drug prices and infrastructure. He claimed the party "can't do anything." (House Democrats have passed multiple bills this year related to money in politics, gun control and health care, which the GOP-held Senate has not tried to approve.)

When Trump walked out of the infrastructure meeting with Pelosi and Senate Minority Leader Chuck Schumer last month, he said he would not work with them while Democratic-led congressional committees investigated him. On Tuesday, Pelosi said that "when it came to pay for [an infrastructure plan], he diverted attention to personal matters."

Trump and Congress have several high-stakes issues to hash out in the coming months. Top Republicans and Democrats in Congress have so far struggled to make progress to raise the U.S. borrowing limit. The Treasury Department could run out of money to pay its bills by the end of the summer if Congress fails to lift the debt ceiling.

Lawmakers will have to pass a spending plan by the end of September to avoid a government shutdown. In addition, the White House hopes lawmakers can ratify the USMCA in the coming months. Passing the trade agreement is a top economic and political priority for Trump.

Mulvaney said Tuesday that he believes the trade deal will pass in both the House and Senate. But he questioned whether Pelosi would bring it to a vote.

"We just do wish that the USMCA could proceed because the votes are there. ... Getting any major piece of legislation passed in this environment is very, very difficult to do. So if you have a piece of legislation that could do that on a bipartisan basis, why not? And really maybe the only argument is because it makes the president look good," he said.

Subscribe to CNBC on YouTube.