The suspect makes an initial appearance before a judge and pleads guilty or not guilty. If he or she pleads guilty to a petty offence, the next step is sentencing, which could happen right then and there. For misdemeanors and felonies, the flow-chart is quite different. Bail hearings and arraignments occur before the trial, the arraignment for the purposes of registering a plea. Ninety per cent of suspects plea bargain with the prosecution, thus avoiding a trial and going straight to sentence.
Some basic principles apply to all criminal laws.
Similarly, it is not legal for a government to increase the punishment for a crime previously committed. These are based on the legal principle that conduct is neither crime nor susceptible to punishment without a law which prohibits that conduct. On this basis, vague criminal laws are void. Laws which prohibit but stipulate no punishment do not create a crime. For a conviction, there must be an illegal act.