Prove that:In a commutative ring $R,$ $x = uy$ for some unit $u \in R^{\times}$ iff $(x)=(y)$ as ideals.
My thoughts:
I feel like the idea is similar to the proof of the following proposition:
Proposition. Let $I$ be a left or right ideal of a ring $R$ with unity. Then $I = R$ if and only if $I$ contains a unit.
Proof: Let $I$ be a left ideal of $R$. If $I = R$ then $1 \in I$, so $I$ contains a unit. Conversely, if $u \in I$ is any unit, let $u^{-1}$ be its inverse. For any $r \in R$, we have $r = r (u^{-1} u) = (r u^{-1}) u \in I$, because $I$ is a left ideal. Thus $I = R$. This logic is easily adapted for right ideals to show the same result. Certainly it then is true for two-sided ideals and ideals of unital commutative rings.
But still I do not know how to write a rigor proof, could anyone help me in doing so please?