I know youre being funny about it, but I need to point out the officer's oath is not to the president, and the supreme court is irrelevant in this.
Specifically any orders which violate the constitution, federal law, or (specifically an "or" here, not "and") international law should be refused. Typical examples are torturing people who are detained, targeting civilians, etc.