In the medieval period, there were different methods of determining whether an alleged criminal was guilty. Failing sufficient proof of accusations of adultery, theft, murder, etc. medieval people relied on God and on nature to act in an unusual way, which would prove innocence or render the guilty the ultimate punishment.
A person accused of a crime first sought the aid of "oath-helpers," who could attest to his / her character, or whereabouts at the time of the alleged crime. For someone whom everyone adjudged to have a terrible character, this was not possible. In that case, the people relied on trial by ordeal.
There were three types of ordeals used to determine guilt or innocence: fire, water and combat. A priest presided over these rituals, which required that the natural elements behave atypically. Fire or hot metal would not burn the innocent, cold water would not allow the guilty to sink, and the innocent would have the strength to defend themselves in mortal combat.
In trials by fire, the most common usage was hot iron, though retrieval of something from a pot of boiling water was also popular. After a solemn three days of fasting and prayer, the accused would take a hot iron from tongs held by the priest, walk three paces (or nine feet dependent on church rules) and release the iron. His or her hand would be bandaged and marked with a seal. After three days, the priest inspected the wound. If it was healing without discoloration, the accused was vindicated, but if the wound festered, punishment for the guilty waited.
For trials by water, the accused removed the clothing and had his or her hands and feet bound with rope. Dumped into a pool or stream, a priest adjudged that only the innocent would sink but the water would allow a guilty person to float. Surely to the innocent who drowned, their vindication after death didn't matter! This practice continued in the later periods of witch hunts.
Lastly, trials by combat had rules specifying where they could take place, the armaments allowed, and even the behavior of spectators. The priest exhorted each man to prove his cause by defeating the other; women, the sick and clergy often engaged professional champions to fight on their behalf. If the accused lost the battle, he or she was guilty of the crime, for surely, God would not allow an innocent person to suffer.
Medieval people abandoned these practices after 1215, resorting to juries. It's easy to see how guilt and innocence could be misjudged. In the medieval legend of Tristan and Isolde, after her husband Mark suspects their affair, Isolde agrees to trial by hot iron. Her lover comes to her dressed as a pilgrim and carries her to the trial. This enables Isolde to later swear a sacred oath that no other man had ever touched her, except "the poor pilgrim" whom her husband had seen carrying her.