How does the N in NO2 have a oxidation state of 4+

please explain

All compounds are zero.

O is -2, two of them = -4. So N must be +4 for the compound to be zero.