New presidents typically find the adjustment from candidate to leader to be a jarring one, and Mr. Trump was not the first to get drawn into the latest flap in a way that fritters away whatever political good will comes with an inauguration. Former President Bill Clinton got off to a tough start by engaging on issues that were not central to his agenda, most notably gays in the military, and took a while to learn how to focus on his highest priorities.

But Mr. Clinton showed none of the combativeness and anger of Mr. Trump.

“The adjustment from private citizen to running the country is unbelievably hard,” said Dan Pfeiffer, a longtime adviser to former President Barack Obama. He said that what people, even new presidents, often fail to fully understand “is that after you stand out there in the weather and take the oath of office in front of an adoring crowd, you walk into that building and you are in charge of the free world.”

At first, at least, Mr. Trump seemed to be resisting the notion that he should adjust his approach now that he is in office. After all, his pugilistic style was a winning formula, one that got him to 1600 Pennsylvania Avenue in the first place. Many of his supporters cheer him taking on the establishment. And some allies said any blowback would not matter long anyway.

“Ultimately this is about governing,” said former House Speaker Newt Gingrich, who has advised Mr. Trump. “There are two things he’s got to do between now and 2020: He has to keep America safe and create a lot of jobs. That’s what he promised in his speech. If he does those two things, everything else is noise.”

“The average American isn’t paying attention to this stuff,” he added. “They are going to look around in late 2019 and early 2020 and ask themselves if they are doing better. If the answer’s yes, they are going to say, ‘Cool, give me some more.’”