A party can ask a judge to recuse at the outset of a case for bias or other reasons (e.g. a family connection to a party). Generally, a judge rules on that motion personally and it is an interlocutory motion not subject to appeal except by extraordinary writ (or the equivalent) to the state supreme court.
It is not generally proper to do so during a trial.
Moreover, one jeopardy has attached in a criminal trial (which happens when the jury is sworn) if the trial ends prior to a jury verdict for reasons other than those attributable to the defendant, the defendant cannot be tried again on those charges and is functionally acquitted.
There are probably some arguable exceptions to this rule in extraordinary circumstances that are not the fault of either party (e.g. if a meteor hits courthouse and kills the judge and some jurors mid-trial, or if it is revealed that the judge committed the crime for which the defendant is being tried). But the threshold for exceptions to the general rule is very high.