In the ring $\mathbb Z_n$, the divisors of zero are precisely those elements $m\in \mathbb Z_n$ such that $(m,n) > 1$.
Proof:
Let $d = (m,n)$ and note that $$m\cdot \frac nd = \frac md \cdot n \equiv 0 \ \ \ \ (\text{mod } n).$$
If $d > 1$, then $0 \not\equiv n/d \pmod n$ so that $m$ is a zero divisor. Conversely, if $d = 1$ and $ma \equiv 0\ (\text{mod }p)$, then $n|ma$ so that necessarily $n|a$. This implies $a ≡ 0 \ (\text{mod }p)$ so that $m$ is not a zero divisor.
Please help explain the proof in a more lucid language.