If and when Trump is placed in “state custody,” meaning either put in jail or placed under some other judicial restraint, then he can file a habeas petition in federal court. That normally requires exhaustion of state appellate remedies first, but there is an exception where “ circumstances exist that render such [state corrective] process ineffective to protect the rights of the applicant”
The habeas writ can be filed directly with SCOTUS without going through the lower courts first, but such direct writs are extremely rarely granted. This is obviously an extraordinary case, so it could happen.
If the judge simply allows Trump to remain at liberty pending appeal, however, then there would be no federal have as jurisdiction, and he would have to proceed through the state appellate process and then petition SCOTUS for certiorari from the final judgment of the NY Court of Appeals (NY’s highest court).
nice explanation...thank you for that...