If a local police officer knows that a law exists and is familiar with its details, and they observe or otherwise become aware that said law is being broken, and they have the resources, means, jurisdiction, and opportunity to enforce said law, do they have any legal obligation to enforce that law (and/or are there established criteria for making a decision to enforce it)? And, if they do or do not, are there any exceptions either way?
In particular, I'm asking about NYPD local precinct general patrol, traffic patrol, and investigators, (as opposed to e.g. school / housing, parking, crossing guards, auxiliary, etc.) but I'm also wondering about local / municipal police in general in the USA (although I presume if such an obligation exists, it would be on a state level or lower).