In act three, John Proctor goes to the courts with Giles Corey and Francis Nurse, all in the hopes of providing evidence that will help to set their wives free. All three of their wives have been arrested, and they are desperate to get them out--the "evidence" is shaky and illogical at best, and so they come to the courts armed with several different tactics in the hopes that they can prove their wives' innocence.
As John comes to the courts, he knows that the girls are all liars, and fakes. He knows this because in act one Abby herself told him that the dancing in the woods "had naught to do with witchcraft." The entire foundation of their validity as testifiers lies in the fact that they accused women of bewitching them into dancing in the woods. Also, Mary Warren herself has told him that they are all pretending. So, he knows that the girls are false, and is prepared, if necessary, to testify to this. His main purpose in doing this is to prove that his wife is innocent (because they girls lied when accusing her), and secondly, to prove that anyone that the girls accused is also innocent (because the girls were lying). He cares mostly for setting his wife free, but also wants to help the wives of his friends too.
The proofs that John offers are first of all, a petition that people signed, attesting to the Christian nature of the women accused. That doesn't work. Then, he plans on Mary's testimony standing as a witness that the girls are false. That too fails. His last resort, one he didn't want to use, was to reveal his affair with Abby, in the hopes that it will discredit her reputation as a "saint." That too, fails, when Elizabeth lies to protect his honor. So, despite John's intents against the girls, he fails, and is himself arrested. I hope that those thoughts helped; good luck!