WASHINGTON—President Donald Trump this week stepped up preparations to counter political and military challenges that could reshape his presidency, girding for a strike against Syria and pushing a campaign to discredit the Justice Department.

Several aides described Mr. Trump seething over an FBI raid of his personal attorney’s files and expressing horror at pictures of lifeless Syrian children following a suspected chemical attack. The combination tested Mr. Trump’s ability to focus on—and compartmentalize—issues as few...