Trial is the formal presentation of evidence to either a judge or jury for determination of whether there is sufficient evidence to find the defendant guilty. The defendant gets to choose whether they want a jury trial or a bench trial. At a bench trial, the judge determines all the issues and renders a verdict. At a jury trial, either 8 or 12 jurors (depending on the offense) decide issues of fact while the judge rules on issues of law and admissibility of evidence.
The prosecution presents their evidence first. This generally consists of witnesses and exhibits of various kinds. The defense attorney has the opportunity to cross-examine each of the prosecution witnesses and challenge each piece of evidence. After the prosecution has rested their case, the defense attorney has the same opportunity to present witnesses and evidence in favor of the defendant. The prosecution, in turn, gets the opportunity to challenge the defense case.
Admission of evidence at trial is controlled by various court rules, statutes, and caselaw. Each side at the trial must follow the rules of evidence that are established to promote a fair trial.
After the presentation of evidence, the prosecutor and defense attorney have the opportunity to argue their case to the judge or jury with closing arguments. The judge or jury then deliberates and returns with a verdict. If that verdict is not guilty, the defendant is free to go. If a guilty verdict is returned, the case proceeds to sentencing, usually on a separate date at a sentencing hearing.