You should learn the universal properties that Martin mentions, since they will save you some work in the future. See this answer of Bill Dubuque's and Wikipedia.
To begin, define a $k$-algebra homomorphism $f\colon k[x, y, z] \to k[y]$ by $x \mapsto 0$, $y \mapsto y$, $z \mapsto 0$. In other words, $f$ sends $p(x, y, z)$ to $p(0, y, 0)$. Since $f(xy - z^2) = 0 \cdot y - 0^2 = 0$, we get an induced map $\tilde f\colon k[x, y, z]/(xy - z^2) \to k[y]$ such that the composition
\[
k[x, y, z] \to k[x, y, z]/(xy - z^2) \to k[y]
\]
is $f$. It's easy to check — and I think you've done this — that $\bar x$ and $\bar z$ are contained in the kernel of $\tilde f$. You want to show that these two elements generate the kernel as an ideal. At this point there are a few ways to proceed. You could note that the above sequence induces
\[
k[x, y, z]/(x, z) \stackrel{\sim} \to (k[x, y, z]/(xy - z^2))/(\bar x, \bar z) \to k[y]
\]
and that this composition is an isomorphism.