@Dale M is basically correct, but fudges a bit on the process.
The court issuing the order would issue an order to show cause to a government official who is alleged by the person who sought the order to have violated the order after having received legal notice (i.e. service) of the order.
If that individual fails to appear at the appointed time and place in the order to show cause, a warrant issues for that individual's arrest. If that individual does appear, the allegedly contemptuous individual is read their rights and a hearing date is set.
At the hearing, if the person appears, the person seeking the contempt finding (or some other attorney appointed by the court) prosecutes the case and if the person is found in contempt, then contempt sanctions issue. If they do not appear, a warrant issues for their arrest and a hearing is held on the merits promptly following that arrest.
An individual can also be ordered to show cause in an official capacity in which case the contempt sanctions would be imposed against the organization rather than the individual.
Usually, in federal court, the U.S. Marshal's office has primary responsibility for arresting people on contempt warrants. The U.S. Marshal's office primarily reports to the judicial branch, although strictly speaking, it is part of the Justice Department, and ultimately reports to the Attorney-General.
There are actually two kinds of contempt - remedial and punitive. Remedial contempt sanction can include indefinite incarceration or a fine (often a per day fine) until the violation of the order of the court ceases and is allowed only when it is possible to comply with the order going forward. Punitive contempt has a sanction comparable to a misdemeanor conviction and applies in cases where the goal is to punish someone for a past violation of a court order whether or not it is possible to comply going forward.
(Both of these are examples of "indirect contempt", i.e. violations of court orders that take place outside the courtroom. A different summary process called "direct contempt" applies when someone misbehaves in the presence of the court - this is summary incarceration or fine without a trial on the spot for disrespecting the dignity of the court in the courtroom.)
Established practice is to direct a contempt order at the lowest level official necessary to remedy the violation of the order. There are a few examples in living memory of cabinet members being held in contempt, however (e.g. the Secretary of Interior, with regard to Indian Trust fund litigation), and keep in mind that in the case of remedial contempt an official can purge the contempt and be released from any sanction by resigning from office, after which the official no longer has the ability to comply.
I am not aware of any instance in which the President of the United States has personally been held in contempt of court, but I am also not aware of any authority that specifically prohibits a court from holding the President in contempt of court.
While contempt is the only "hard" remedy for a violation of a court order, the bureaucratic structure of the federal government is also set up in a manner that once a court order definitively resolves a legal issue, the higher ups in a federal agency are supposed to take all reasonable actions to insure that their subordinates follow that order (and they are themselves subject to contempt sanctions if they fail to do so). And, keep in mind that most of the people in the chain of command are civil servants with legal protections from unlawful employment actions hired on a merit basis, not political appointees, and that lots of the people in the chain of command are also members of unions that provide individual employees with the ability to fight wrongful employment action from a superior for violating a court order.
In particular, the top lawyers in the executive branch would in ordinary times direct government employees to follow a clear court order and to cease and desist from explicitly disobeying one. Among other things, the courts could probably deny lawyers who refused to do so the right to practice law in federal court. But, usually things never reach this point. Then again, we are living in interesting times.
There are about 670 political appointee positions in the executive branch, many of which are currently vacant and less than a dozen of which would be relevant to any given dispute in any case. There are about a million, civilian, non-defense department, non-postal service employees in the United States government, of which perhaps 100,000 or so are in the Department of Homeland Security and fewer are in the CBP. As far as I know, the CBP political appointees from the Obama administration have resigned and a replacement has not been confirmed by the U.S. Senate yet (there has been a Department of Homeland Security appointee confirmed if I recall correctly), and there are only a few people in the agency that political appointees can hire without either receiving Senate confirmation or using the merit based hiring process for civil servants (which takes a while, especially given an executive order imposing a hiring freeze). So, realistically, we have a case where the acting head of the CBP is probably a GS-15 or Senior Executive Service grade civil servant, rather than a political appointee, at the moment, who was hired as a civil servant many years ago, who is doing his (or her) best to follow the less than clear guidance he is receiving from his superiors and government lawyers (perhaps errantly).
There could also be remedies in the form of declaratory judgment. The Court could declare as a matter of law on a case by case basis that, for example, Fatima Jones is not deportable and is lawfully within the United States and is entitled to be released from custody. This specific finding as to an individual would be very hard for the administration to escape sanction for.
And, the Court could also declare that the entire executive order, at least as applied, is invalid (e.g. for failure to comply with the administrative procedures act, or for failing to include an exception for contrary court orders) or is unconstitutional.