A useful trick is to think about the isomorphism $K[x,y] \cong K[x][y]$, i.e.
a polynomial in $x$ and $y$ can be thought of as a polynomial in $y$ with coefficients that are polynomials in $x$.
For a polynomial $g(x)$, we can use the division algorithm to write $g(x) = q(x)(x-a) + r$, where $r$ is a constant. This shows $g(a) = 0$ iff $r=0$ iff $x-a$ divides g.
For a polynomial $f(x,y)$ we can do the same thing, using our trick. Thinking of $f(x,y)$ as a polynomial in $y$ with coefficients in $x$, the $r$ above is now a constant in $K[x][y]$, i.e. a polynomial in $x$. Thus we can write $f(x,y) = q(x,y)(y-b) + r(x)$. Now dividing $r(x)$ by $(x-a)$ we have that $f(x,y) = q(x,y)(y-b) + s(x)(x-a) + t$, with $t \in K$. We see that $f(a,b) = 0$ iff $t=0$.
So we have actually proved the more precise statement that $$(f) \subset (x-a)K[x] + (y-b)K[x,y]$$
Indeed this argument generalizes perfectly well to any amount of variables and any commutative ring with identity.