One of your constitutional "due process" rights is the right to be
told exactly what you're being accused of doing. That happens at an
arraignment ("uh-rain-ment") - the judge reads the charges filed against
you and asks you if you understand what you've been accused of doing.
If you haven't already hired an attorney to defend you, the judge will
ask you if you want one. If you want one and you can't afford to pay
for one, the judge will appoint an attorney to represent you for free
- that's another one of your constitutional rights.
The judge will ask you or your attorney how you plead to the charges
- whether you admit them or not. If you plead "guilty," then you go
on to sentencing, where the judge decides what will happen to you for
breaking the law.
If you plead "not guilty," your case will go to trial, where the prosecutor
will have to prove beyond a reasonable doubt that you did what they
say you did.