Answer: to try to free Elizabeth
Step-by-step explanation:
In The Crucible, he wants to come clean about the affair and expose Abigail Williams. Abigail wants John all to herself, so she attempts to get his wife (Elizabeth) killed for witchcraft. As a result, John goes to court to try and save Elizabeth because he loves her.
Hope this helps!