WASHINGTON—President Trump is shaking up the top ranks of the Department of Homeland Security and has instructed White House advisers to take a more direct role implementing immigration policy in an effort to slow the rise in families illegally crossing the southern border.

Those efforts accelerated Sunday with the departure of Kirstjen Nielsen as secretary of the sprawling agency that oversees the U.S.’s immigration and national-security apparatus.

Mr. Trump in recent days privately signaled he may oust the director of Citizenship and Immigration Services. Last week, he pulled his nominee to run Immigration and Customs Enforcement. Randolph Alles, the Secret Service director who the White House said was departing on Monday, said in a memo to his staff that the administration had told him weeks ago that “transitions in leadership should be expected across the Department of Homeland Security.”

Mr. Trump has also told aides he wants to reinstate his family-separation policy, which provoked a political outcry when it was implemented last spring, in order to deter would-be migrants. An administration official said Mr. Trump recently told Stephen Miller, one of his most hard-line advisers: “You’re in charge” of the administration’s immigration policy.

Immigration policy was a central plank of Mr. Trump’s 2016 campaign, and the Republican president has indicated he plans to run on the issue again as he seeks re-election next year. The White House remains restricted in how far it can go by the courts, which have repeatedly ruled against the president’s immigration initiatives. On Monday, a federal judge blocked an administration policy of returning asylum seekers to Mexico.