How does nitrogen dioxide deplete ozone and lead to smog at the same time?

How does nitrogen dioxide harm ozone and lead to smog at the same time?