Often failure to perform by one party is a condition precedent to performance by the other party, so the first breach relieves the second breach.
The scenario in the title of the question, where party A says: "I repudiate the contract and will not be performing in the future", and then party B says, "Because you repudiated, I'm not going to perform going forward either.", is an easier case.
Doctrinally, the law isn't terribly complicated, but applying it to the facts is tricky. In the case that you propose, a judge looking at the situation after the fact with 20-20 hindsight has to decide:
- Did Party A's claimed breach really happen?
- Was the breach by Party A material?
- Does the express language of the contract discuss a right to terminate?
- Was it reasonable to infer in the context of the contract that performance by Party A was a condition precedent to performance by Party B?
The case law disfavors a finding that a contract term is a condition precedent to an obligation, but that doesn't mean that there aren't plenty of circumstances when performance by A is a condition precedent to performance by B.
There are well settled areas, like real estate purchase contracts, where these questions can be very clear.
But, the farther you get from the heartland of plain vanilla cases with lots of precedents that define them, the harder it is to accurately evaluate how a judge will decide a case.
You really want to have case law that is four square factually similar to your own case to have real confidence about how a factually rich context will be evaluated.
Fortunately, New York State has case law that goes back to before the United States of America even existed and had a high population engaged in lots of economic activity for most of that time, so if anyplace is going to have case law on point is a mildly unusual situation, New York is likely to be it. But, unfortunately, there is really no reliable way for a lay person to access that case law.
Like @DaleM, I concur that seeking legal advice is appropriate if the stakes are high enough to make a worst case scenario liability of several thousand dollars or more (including attorneys' fees if the contract has an attorneys' fee shifting clause). Evaluating the specific facts of your case through the filter of mountains of case law is more art than science and not something that is easy for you to evaluate yourself.