The result is not true in general.
Let $X$ be a countably infinite set with the cofinite topology, i.e., $U\subseteq X$ is open iff $U=\varnothing$ or $X\setminus U$ is finite. Let $p=\langle x,y\rangle$ be any point of $X\times X$, and let $U$ be any open neighborhood of $p$ in $X\times X$. Then there are open sets $V$ and $W$ in $X$ such that $x\in V,y\in W$, and $V\times W\subseteq U$. Since $V$ and $W$ are open in $X$, there are finite sets $F_V$ and $F_W$ such that $V=X\setminus F_V$ and $W=X\setminus F_W$. $F_V\cup F_W$ is still finite, so $V\cap W=X\setminus(F_V\cup F_W)\ne\varnothing$. Pick any point $z\in V\cap W$; then $\langle z,z\rangle\in(V\times W)\cap\Delta\subseteq U\cap\Delta\;,$ so $U\cap\Delta\ne\varnothing$. $U$ was an arbitrary open neighborhood of $p$, so $p\in\operatorname{cl}\Delta$. And $p$ was an arbitrary point of $X\times X$, so $\operatorname{cl}\Delta=X\times X\ne\Delta$, and therefore $\Delta$ is not closed. But $X$ is countable, so it is certainly separable: it is a countable dense subset of itself.
In order to prove that $\Delta$ is closed, you want to assume that $X$ is Hausdorff, meaning that if $x,y\in X$, and $x\ne y$, then there are open sets $U$ and $V$ such that $x\in U,y\in V$, and $U\cap V=\varnothing$. Now suppose that $p=\langle x,y\rangle\in (X\times X)\setminus\Delta$. Then $x\ne y$, so there are disjoint open sets $U$ and $V$ in $X$ such that $x\in U$ and $y\in V$. I leave it to you to show that $U\times V$ is then an open neighborhood of $p$ disjoint from $\Delta$. This will show that every point of $(X\times X)\setminus\Delta$ has an open neighborhood disjoint from $\Delta$ and hence that $\Delta$ is closed.