Find a Lawyer
Rather than focusing on the crimes themselves, the law of criminal procedure governs the process of bringing criminal charges, and, if necessary, putting the defendant on trial.
The first step in any criminal prosecution is usually the arrest of a suspect. There are certain rules that the police have to follow when arresting a person. First of all, unless they witness the person committing a crime, they need to have an arrest warrant before they can arrest someone.
An arrest warrant is a court order which gives police officers in the relevant jurisdiction the power to arrest someone. Generally, if more than one person is suspected of being involved in a crime, a separate arrest warrant must be issued for each person. In order to get an arrest warrant, the police have to go to a court with enough evidence to show probable cause that the person they are seeking committed the crime in question. "Probable cause" is a fairly easy standard of proof to meet, as it only requires a reasonable belief that the suspect committed the crime. This is enough for the initial arrest, but it is nowhere near enough for a conviction.
When the suspect is arrested, they are usually informed of some of their rights as a matter of course. This is known as the "Miranda warning." The exact wording of the warning varies, but the substance is the same: in order to interrogate a prisoner, and have the suspect's answers be admissible in court, the suspect must be informed that he or she is under no obligation to talk ("the right to remain silent"), and that, if they do choose to talk, anything they say can be used as evidence against them. The suspect must also be informed that they are entitled to have an attorney present during an interrogation, if they so choose. However, if the suspect requests an attorney, the police typically stop the interrogation. The police can be quite manipulative, and convince the suspect that it is in their best interest to waive their rights, and start talking.
Some people assume that if you aren't "read your rights" when you're arrested, some egregious violation of your rights has taken place, and you automatically get to go free. This is not true. If you are not informed of your rights, and then interrogated, it's possible that anything you say won't be admissible in court. If the prosecution's only evidence against you is a confession, this might result in the case being dismissed. However, if they have enough evidence to convict you, with or without a confession, it won't matter if they read you your rights or not.
Once the defendant has been arrested and charged, they typically have to enter a plea. If they plea "not guilty" – the case goes to trial. At a trial, the prosecution has to prove that the defendant is guilty "beyond a reasonable doubt." This essentially means that a jury must be convinced that the defendant is guilty, and that there is no reasonable alternative explanation to the crime.
Note that there can always be some doubt as to the guilt of the defendant, which is why the prosecution is only required to eliminate doubts which one might reasonably hold. For example, suppose that a defendant is caught on a security camera robbing a bank. The camera captures perfectly clear images of the defendant's face. On top of that, the defendant's fingerprints are found all over the bank that he is accused of robbing. This would almost certainly be enough evidence to eliminate all reasonable doubt, allowing for a conviction.
If and when the defendant is found guilty by a jury, it is up to the court to determine the appropriate punishment for the crime. Generally, the law will create a minimum and maximum sentence for a given crime, and the judge typically has discretion to sentence the defendant within that range.
In determining the appropriate circumstances, the judge can consider many facts that might not be directly related to the defendant's guilt or innocence, but which might warrant a lighter sentence, such as the fact that the defendant was abused as a child, had a history of untreated mental illness, or similar things.
However, any fact which can be used to increase a defendant's sentence (such as a hate-crime enhancement) must be proven beyond a reasonable doubt at trial, like every element of the crime in question.