Do I correctly understand that Federal employees, notably including
the Armed Forces, pledge their duty first to the Constitution of the
United States and only secondarily to carry out legal orders? And that
they have no legal obligation to execute an illegal order? What
process allows a subordinate to defy an illegal order if a superior
gives the order? What legal protection does the subordinate have?
All officers of the United States government (and for that matter also all officers of state and local governments) including soldiers in the armed forces are sworn to uphold the Constitution.
Members of the armed forces are not only allowed to disregard illegal orders, they are obligated to not carry out illegal orders.
Operationally, disobeying an order due to the fact that it is unconstitutional is a defense to an effort to fire or discipline a federal government civil service employee who may only be fired for good cause after due process. In the military, the issue would usually present itself in the form of a defense in a court martial for refusing to obey a lawful order of a superior.
Of course, it would hardly be unprecedented for someone's firing from a job that was unlawful, or for a wrongful court-martial conviction, to be upheld on appeal.
Suppose the Congress holds someone in contempt. The Congress, as I
understand it, goes to a court to enforce the contempt charge. The
court turns to Federal law enforcement to bring action. What if the
President directs Federal law enforcement to ignore the court order?
What if law enforcement complies with the President?
The U.S. Justice Department is charged with bringing contempt of Congress cases at the request of Congress.
But, an attorney retained by Congress could probably bring such an action in the U.S. District Court of the District of Columbia if the U.S. Justice Department refused to do so. Contempt may be civil or criminal, and unlike ordinary criminal charges (felonies can only be brought based upon grand jury indictments and grand juries are controlled by prosecutors) either civil or criminal contempt charges can be brought by a non-governmental employee attorney.
The established practice is to seek contempt sanctions against the lowest level employee who has the authority to take the action requested, or to seek contempt sanctions against everyone from that lowest level employee up through the chain of command to the responsible cabinet officer. The President is generally not named as a party against whom contempt charges are sought.
Defiance of the law in the face of a binding and immediately effective court order would be a constitutional crisis and you would need to move to the realm of politics and political realities, and away from the realm of what the law says that people should or should not do, to meaningfully predict how a constitutional crisis turns out.
The law assumes that all government officials will obey a lawful court order duly enforced. If government law enforcement officers start defying court orders, then there is a constitutional crisis.
On the other hand, the vast majority of law enforcement officers in the United States are civil servants who aren't beholden personally to the President. They were appointed on a merit basis, they are civil servants who can't be fired without good cause and due process, they are in agencies that have an institutional culture of obeying court orders. The civil servants with more seniority (and basically all senior military officers in the U.S. military) have served under multiple Presidents of different political parties. The number of political appointees supervising them is fairly modest. Likewise, most federal judges at any given time were appointed by prior Presidents and even judges appointed by a current President will not infrequently rule against the federal government when the facts and law demand that they do so. There is less politics and there is more unity in interpretation of the law among federal judges and federal law enforcement and legal officials than is generally assumed by more cynical members of the general public.
Suppose Congress orders fines. What is to be done if no one will
enforce the fines?
A court can order that the fines be paid out of the U.S. Treasury. The order itself can have the force of law without the cooperation of any U.S. Treasury official. Sustained defiance of such a court order would lead to a constitutional crisis.
Same scenario as 1 but this time it’s impeachment and conviction: the
President defies any action to remove him.
What if the President simply barricades himself in the White House and
orders security and military personnel to protect him? Is there a
protocol in the U.S. military hierarchy to deal with this scenario?
This has never actually happened, of course, so it is hypothetical. The Treasury Department, General Services Administration and Secretary of State (and all other government officials) should revoke privileges that the President has by virtue of being President and provide them to the new acting President (realistically, in the simple scenario presented, current Vice President Pence).
The military should stay out of it, but should immediately start treating acting President Pence, and not the impeached incumbent as the Commander-in-Chief. U.S. military forces are indoctrinated on the Presidential succession and it is unlikely that many military officers would disregard a Presidential impeachment.
The Secret Service should stop defending the former President except in an ex-President capacity. In theory, one could imagine acting President Pence bringing an eviction action in the local courts of the District of Columbia just as one would with any holdover tenant. Since the local courts in D.C. are federal, this doesn't present the federalism problems that it would if the same thing were done in a state court with respect to federal real estate, and U.S. marshals would evict him and his family like anyone else.
The trickier situation in terms of creating a constitutional crisis, honestly, is really one where the President is clearly and blatantly defying the law and court orders, but the U.S. Senate refuses to convict the President in an impeachment proceeding out of partisan bias.
What should common citizens do if any of these scenarios play out?
Whatever they want, in a lawful manner. Ultimately, this would be a matter for federal government officials (elected and appointed alike) to figure out.