Two systems, similar conduct
In California, violating a restraining order or protective order is generally charged under a Penal Code provision for disobeying such orders, often as a misdemeanor, though repeat violations or violations involving violence can be treated more seriously. California also issues several types of orders, including domestic violence restraining orders from family court, civil harassment orders, and criminal protective orders in a pending criminal case. In New York, the usual term is order of protection, and an alleged violation is generally charged as criminal contempt, which can be a misdemeanor or a felony depending on what is alleged and on the person's history. In both states, the violation charge is a separate case from whatever led to the order in the first place.
Common ways violations happen
Many violations involve contact the person did not think counted: replying to a message the protected person sent first, reacting to a social media post, asking a relative to pass something along, or attending an event the protected person also attended. Some orders allow peaceful contact for limited purposes, such as exchanging children, while others bar all contact, and the difference is in the order's wording. Keep the order itself, any proof of service, and every message you received, and do not respond. Federal law and California law also restrict firearm possession for people subject to many protective orders, so ask your lawyer what the order requires of you on that point.
Where the case needs to be handled
A charge filed in California is prosecuted in California courts under California law, and it generally needs a lawyer admitted there. SJKP LAW FIRM LLP practices in New York, and if your case is here we can review the order, the alleged contact, and the related case together. If the case is in California, we can talk through the issues with you and what to look for in counsel there. Wherever the case is, the first steps look alike: stop all contact, follow the order exactly, and avoid explaining yourself to anyone other than your lawyer.