In criminal law, a person is guilty if a court has decided they have done something illegal. If a person has broken a law by stealing, for example, they are guilty of a crime.
A person is guilty if a court says they are. The court has blamed them for doing something wrong. A guilty person is punished. The punishment is called the sentence.