Since $k$ is a field, the ring of polynomials $k[x]$ will be a PID, and hence we can describe what the prime ideals of $k[x,y]\cong k[x][y]$ will be as is explained in the linked post. Now, given any commutative ring $R$ and some ideal $I$ of it, the quotient $R/I$ will be a flat $R$-module if $I^2=I$ (to see this, tensor the exact sequence $0\to I\to R$). If moreover we assume that $I$ is finitely generated, we get that $I=(e)$ where $e$ is an idempotent of $R$. Consider $k[x,y]/(x-y)$ as an $k[x,y]-$module.
It is clear that $x-y$ is irreducible as a polynomial over $k[x]$ in $y$, hence it is prime.
How would we go about showing that $V((x-y))$ is clopen (or not) in $\text{Spec} \ k[x,y]$?
The algebraic variety is the diagonal of $k^2$, but I do not know if this tells us anything about the structure in the spectrum.
I apologize in advance if the question has been asked or if I'm not understanding the definitions properly, I've started learning about these things recently and am still a little confused about everything.
I appreciate any answer!