Rules of court procedure are specific to the individual court system. An appeal normally involves filing paperwork with the appeals court and the court you're appealing from, and serving some form of notice on the other side.
An appeal normally has to come at the end of the lower court proceedings. This is for practical reasons: it's time-consuming to transfer the case to a new court, brief the issue, and argue the issue, all for something that might end up not mattering at all. If the trial has actually started, doing that breaks the flow of the trial. Instead of going back and forth and back and forth, courts generally expect you to wait until the lower court has issued a final judgment, at which point you can appeal both that judgment and anything leading up to it. For instance, if you try to have evidence suppressed and fail, you can't appeal immediately. If you end up being convicted, you can then appeal on the grounds that the evidence should have been suppressed (if you're acquitted, there's no point appealing).
There are some exceptions to this rule where you really can't wait for the lower court proceeding to finish. In the US, a common example is orders granting or denying preliminary injunctions. The whole point of preliminary injunctions is that the issue really can't wait for the trial to finish, because by the time that happens one or both sides will have suffered irreparable harm. So, they can be appealed immediately. Another example in criminal cases is certain orders favoring the defendant. Because the prosecution can't appeal an acquittal, they can't wait until the final judgment and have to be able to appeal right away. These appeals are called interlocutory appeals.
A dismissal of a case with prejudice is a final judgment: it ends the case, and so you can appeal. A dismissal without prejudice (meaning you can fix the issues and refile) may or may not be appealable, depending on the court. But refusing to dismiss a case isn't a final judgment, because there's still plenty to do (i.e. an entire trial) in the lower court. Even if you should have won a dismissal, that doesn't mean the appeals court will step in early and save you the burden of a trial. One judge has already ruled you have to stand trial, and in most cases that's enough for you to have to stand trial.
There are some exceptions that let you appeal the denial of a motion to dismiss. For instance, foreign sovereigns normally have immunity in US courts, and can immediately appeal if the immunity is refused. Public officials who are being sued and assert qualified immunity can immediately appeal if the court refuses it. If you're being prosecuted and claim double jeopardy, you can appeal if the court denies the claim. Anti-SLAPP laws often provide for immediate appeal if the anti-SLAPP motion is denied.
What these cases have in common is that the law protects you from even standing trial for the claim. Trials are expensive, stressful, and time-consuming, and each of these cases has important reasons why you're entitled to avoid it. Forcing a sovereign to stand trial in US courts can seriously hurt foreign relations, so before it happens the courts need to make sure that US law really does require it. Qualified immunity exists so that officials don't always have to second-guess themselves; if they had to sit through an expensive trial, the point would be lost. Ditto for anti-SLAPP cases. Double jeopardy protects you from the government repeatedly putting you through the extreme stress of criminal prosecution (on the other hand, you can't generally do an interlocutory appeal on speedy trial grounds, because the appeal would just delay your trial even more).
So, in your example: In general, in the US, you can't appeal a court refusing to dismiss your criminal case until the end of the trial unless your motion to dismiss was on double jeopardy grounds (in which case you file an interlocutory appeal). A guilty plea does result in a final judgment, but it's extremely risky to plead guilty on the theory that you'll immediately appeal: if you lose the appeal, you've forfeited your right to an actual trial. If you try to have your case dismissed but the court refuses, the appropriate action is to try to win the case in the lower court. If you lose, only then can you appeal.