I have the cone $$X=\{(x,y,z)\in\mathbb{A}^3 \mid z^2=xy\}$$
and the regular function $f=x\in\mathscr{O}_X$. I don't understand why the Weil Divisor associated to $f$ is $\mathrm{div}(f)=2L$ where $L\subset X$ is the line defined by equations $x=z=0$. I don't know what is the general method to find a divisor because I'm new in algebraic geometry. Thanks.
Let $R = k[x,y,z] / ( z^2 - xy)$, and $p = (x, z)$. Then, $m_p^2 \subseteq R_p$ is generated by $(x,z)^2 = (x^2, xz, z^2) = (x^2, xz,xy)$. Since $y$ is invertible in $R_p$, and $xy \in (x,z)^2$, $x \in m_p^2$.
Now consider $m_p^3 = (x) * (x, z) = (x^2, xz)$. This time, $x$ is not in $m_p^3$. Therefore , the valuation of $x$ at $p$ is $2$.