When John Proctor says these words to his servant, Mary Warren, a rather meek girl—who he once called a "mouse"—because he is hoping to give her some strength. He has brought her to the court, somewhat against her own will, in order to testify against Abigail and the other girls, who she knows are lying to the court when they accuse others of witchcraft. Deputy Governor Danforth is a pretty frightening figure, and Mary "suddenly sobs" as he is speaking.
Mary is not a particularly strong girl; in act one, we saw her argue that Abigail and the other girls would have to confess what they were doing in the woods so as to avoid worse consequences. However, when Abigail threatened her personally, implying that she would hurt Mary or worse if she told on them, Mary backed down. Though Mary advocated for what was right, she's also gone along with Abigail's efforts to manipulate and control, knowing that those accused were really not witches.
Therefore, we shouldn't be surprised when she, later in act three, turns on Proctor too. He tries to shore her up, to help her understand the importance of doing right and to reassure her that everything will be well if she does the right thing. However, she eventually realizes that this is not true. In doing the right thing now, she puts a target on her own back, and she is the next accused by Abigail. Once Mary realizes that harm will absolutely come to her, even if she does that which is good, she turns her back on truth and goodness both, following the lead of many other girls as well as many of the corrupt adults of Salem (Parris, Mr. and Mrs. Putnam, etc).
This quote is derived from the book of Tobit, which is part of the Biblical apocrypha. An apocryphal book is one that is considered to be of dubious origin or authorship, particularly in the Protestant church. Tobit is considered to be canon among Catholics, however.
The quote is spoken in The Crucible by John Procter to his servant, Mary Warren. He is attempting to give her the courage to testify against Abigail Williams so that the town will see her falsehood. Mary Warren is certainly the least evil of all the girls that have benefited from the witchcraft hysteria. However, she is completely spineless and somewhat justifiably terrified of what Abigail will do to her.
Within the context of the play, the quote is not only ironic but patently untrue as well. John Proctor may not be a character who does or even intends only good things, but he is by a very wide margin more honorable, upstanding, and compassionate than Abigail could ever hope to be. However, he is clearly also in the much less enviable position. Furthermore, it is ironic because Proctor is giving advice that he himself does not follow. He could do the good himself if he would only admit his affair with Abigail at the right time. While it would certainly ruin his reputation, he could at least prevent further evil from taking place.
The significance of this quotation from the Bible is that is has no significance for the person to whom it is addressed, Mary Warren.
One would've thought that in a God-fearing community such as Salem, people would always strive to tell the truth, in keeping with the teachings of Scripture. But in the midst of such an almighty outbreak of mass hysteria, that's no longer the case. Even in Puritan Salem, where every last word of the Bible is normally regarded as inerrant, God's Word no longer has any true purchase.
Mary is so terrified of what Abigail Williams will do to her if she tells the truth that she cannot accede to John Proctor's request—not even when the words of the Bible are put in front of her. It says a lot about how bad things have got in Salem that such a fine state of affairs should now exist. Right and wrong, truth and falsehood, good and evil—these binary opposites no longer have any relevance due to a witch-craze rapidly getting out of control. All that matters is saving your own skin.
All the old values have been turned upside-down, and so John Proctor is wasting his time and breath in trying to get Mary Warren to do the right thing. He's effectively living in a different society to the one that now exists, a society in which the teachings of Holy Scripture actually meant something.
In Act Three, Proctor presents a paper to the courts that contains the signatures of people who are ready to declare their "good opinion" of Rebecca, Proctor's wife, and Martha Corey. All of these ninety-one individuals are farmers and members of the church who have had no "dealings with the Devil" and are, thus, in good standing in the community. Mary Warren has also been brought forward to testify that she and the other girls "afflicted" by the witchcraft were only pretending. Mary is emotionally disturbed by the court's proceedings, and Proctor attempts to calm her:
Now remember what the angel Raphael said to the boy Tobia. Remember it. 'Do that which is good, and no harm shall come to thee.'
Proctor optimistically believes that the truth will come to light by doing good and that Mary (and all others who fight on the behalf of truth) will be protected. Unfortunately, in a community overrun by hysteria, this is not true.
Though Mary tries to stand against the other girls by admitting their actual wrongdoings (their lies about the witchcraft) and Proctor himself confesses his affair with Abigail, their truth-telling and "goodness" is not enough to save them from punishment. Mary is terrorized by the girls into submitting to the hysteria once more, and Proctor is accused of being a man of the devil, resulting in his arrest.
The Crucible is a tragedy because the rules that are usually followed, the rules that we count on to be followed are not. In fact much of what normal people accept as true is inverted. Especially the fact that those who are good are being put on trial and killed for crimes they have not committed. And so the staement "Do that which is good, and no harm shall come to thee," is false.