Proctor brought Mary Warren to the courts to tell the judges that "it were all pretense", meaning, the girls were all pretending, and never saw any spirits. Mary was terrified, because she knew that at any moment the girls could turn on her and accuse her of witchcraft. Abby had already outright threatened them in Act One: "I will bring a pointy reckoning that will shudder you."
So, she spent a week gathering the courage to even come to the court, and once there, she was so terrified that Proctor told her, "Do that which is good and no harm shall come to thee", a quote from the angel Raphael to the boy Tobias. And, to give her credit, she tried, she really did. Unfortunately,Proctor's words of comfort didn't hold, and she chickened out in the end and turned on him.