The trial is where the state, through the prosecutor, tries to prove beyond a reasonable doubt, either to a judge or a jury, that the person accused, the defendant, is guilty of the crime or crimes charged.
The defendant has the right to decide whether to have a trial decided by a judge or jury, but in either case the judge will preside over the trial and make decisions about evidence in the case.
Pretrial hearings are an opportunity for the defense and the prosecutor to discuss the case and potential resolutions. Sometimes the judge is present and provides input, other times is only the defendant's attorney and the prosecutor.
Discovery is the term used to refer to the evidence involved in the case and its exchange between the prosecutor and the defendant. At pretrial hearings both sides can discuss this process as well as evaluate the strengths and weaknesses of the case. Pretrials are used to work out whether a case can be resolved by a negotiated plea or there will be a trial.
At your arraignment you are informed of the charge or charges with which you are accused and the maximum penalty possible if convicted, as well as certain rights you have in the process. You are asked to enter a plea to the charges. Usually a not guilty plea is entered. A not guilty plea is even entered where the accused wants to admit guilt and be done with the whole process. A not guilty plea keeps the case open and allows the defense attorney work for the best resolution possible for his client.