Mary Warren is the Proctors' servant, so John uses his position of authority over Mary to force her to go to court to save his wife. He knows that if he can get one girl to separate from the other "afflicted" girls, then he can overturn the trials. John also knows from what Abigail told him in Act 1 that the girls were only playing around in the woods. He uses this knowledge to take Mary to court along with Francis and Giles' petition to stop the trials and reveal the truth of Abigail's intentions.
When John reaches the courtroom with Mary and she actually confesses to lying about the spirits afflicting her and the other girls, the judges ask her to faint to demonstrate that she was faking all along. Proctor encourages her to do the same, but she is unable to do so. When Mary cannot physically refute the other girls' testimony, Johnattempts to appeal to Mary's sense of morality.He encourages her to "hold to the truth" because "God damns all liars." Unfortunately, none of his efforts prevail, and Mary ends up succumbing to Abigail's threats and coercion.