How are federal orders issued

Do the local and state police have to work together with the federal police?

Local law enforcement officers have enforcement courts limited by the legal jurisdiction of the local government (state or municipality). That is, the power granted to you as a representative of a particular government agency can only extend to the legal jurisdiction of that government.

Specifically, this means that local law enforcement officers are not empowered to enforce federal law (except in certain cases where the federal agency responsible for the law extends powers / represents the local civil servant). You wouldn't expect a local New York police officer to arrest a Canadian citizen for violating Canadian law in the state, including violations of federal law within the state.

In practice, however, this rarely makes much of a difference for offenders, as almost all federal criminal law has parallel state / local law. If you are arrested by a local officer, charges will be brought against local law. Federal lawsuits can be filed later based on evidence available from the local official, but these are filed and executed by federal officials who have these powers.

However, on the rare occasion that state law does not mimic federal law, it is the only time this conflict has been resolved in practical circumstances. To answer your questions, no, the local police force not only has to prosecute people for activities that are legal in the state, they are illegal at the federal level, and they are not. Local officials are also under no obligation to act in any way against their own laws.

However, the local police force has no power to stop law enforcement officers from enforcing federal law in their states. They do not have to assist federal law enforcement officers, but may be arrested themselves for obstructing a federal investigation if they take steps to delay or prevent the lawful arrest of citizens by federal law enforcement officers.

The constitution seeks to make this a non-issue through the supremacy clause (which indicates that any state law that is in conflict with a federal law is unconstitutional and will be replaced by federal law). However, it will require a legal challenge to resolve the specific issues you highlighted for my answer to hold as this goes through the courts.

There are also some areas of law (e.g. immigration) where the state does not have the power to legislate (even in accordance with federal law). In these cases, federal officials typically pass this authority on to local officials for logistical purposes.