How violations are charged
In New York, protective orders are called orders of protection, and an alleged violation is commonly charged as criminal contempt. It can be a misdemeanor or, depending on the conduct and any earlier record, a felony. When the order came from Family Court, a violation petition can be filed there as well, and the two can proceed separately. The judge in the original case may also revisit your release conditions. The protected person's consent to contact generally is not a defense, because the order belongs to the court.
What gets examined
A central question is whether you were served with the order or otherwise knew about it and its terms at the time. The exact wording matters, since a full stay-away order and an order that only bars harassing or threatening conduct cover very different things. Then comes the proof of contact itself: phone records, account access, location data, and whether a message could have come from someone else using a shared or compromised account. Chance encounters in public places, contact through third parties, and indirect social media activity such as tagging have all been the subject of disputes, and courts have treated some indirect online contact as a violation.
What to do now
Do not reach out to the protected person to explain or to apologize, and do not ask anyone to do it for you. Keep your phone and accounts as they are, without deleting messages or posts, and tell your lawyer about any shared accounts or devices. Gather what shows where you were at the times alleged, such as work schedules, receipts, or transit records. If police or a prosecutor ask you about the alleged contact, speak with your lawyer before answering. If the terms of the order are unworkable, for example around children or a shared workplace, the way to change them is a request to the court through counsel, not an informal arrangement.