I am studying witchcraft in the 15th century at the moment, so I’ll try my hand at an answer (I have never posted in this sub before, though, so I do apologize in advance if the answer is not thorough enough).
The circumstances would depend on the when and where, but I can give a few examples from southern Germany in the 1400s. What you were doing could have been any number of things, and your defense would be based on the specific nature of the crime. Virtually any extra-ecclesiastical practice that could be perceived as superstition would be grounds for accusation (unorthodox prayers or use of charms). Maybe you stole a piece of the Host during Mass in order to use its magical properties for reverence or personal gain (as a charm of sorts). Maybe you were accused by a neighbor falling on hard times who suddenly remembered a quarrel you had seven years ago, wherein harsh words were exchanged (now perceived to be actual curses). Maybe you were the unfortunate part in a lover’s quarrel where one of the quarrelers later lost his potency, accusing you of bewitching him. Maybe you just had a too-public disagreement with the inquisitor in question. Maybe you became a bit too involved with a group of heretics-to-be. Maybe you were an academic with an interest in demonology, trying your hand at invocations or the summoning of demons and then being caught in the act (in fact, merely being in possession of demonological treatises would be grounds for suspicion, depending on your social standing and academical reputation).
As we can see from these examples, the list of grounds for accusations is quite long, these being but a handful of many examples. The grounds for accusation as the inquisitor would see it, however, is rather short; sorcery. Any member of the laity believed to be practicing any sort of magic, whether pagan, Christian, or simply superstitious in origin, would be considered highly suspicious.
Your defense, then, would depend on the perceived crime. Most of the above examples are, I think, fairly self-explanatory in terms of defense; you would have to deny the magical (sorcerous) nature of the circumstances and present the case from your point of view. There were cases of accused individuals being released, of course, but the trouble is that depending on the number of ‘witnesses’, accusers and ‘evidence’, the odds will be stacked against you. You wouldn’t be condemned without a confession (that is my understanding at least, practices will inevitably have varied though), but if the inquisitor(s) thought you guilty, or at least sufficiently suspicious, they would usually commence with torture. The nature of those proceedings was such that a confession was usually extracted. Of course, if torture didn’t provide a confession, you would be free to go (maybe with some jail time or other sort of penance).
I’m sorry with the above is too broad and vague, but without specifics in regard to time and place, the circumstances can vary immensely. I recommend the works below to anyone interested in the subject.
Sources: Christopher S. Mackay, The Hammer of Witches, a complete translation of the Malleus Maleficarum
Michael D. Bailey, Battling Demons: Witchcraft, Heresy, and Reform in the Late Middle Ages
Elizabeth I. Wade, Magic and Superstition in a Fifteenth-Century Student Notebook, (Chapter in Fifteenth Century Studies vol. 28)