UFD and its prime element If $R$ is a UFD and  $a,b \in R$ are relatively prime and $a|bc$, then $a|c$.

we know if a and b relatively prime (a,b)=1 so $a\bot b$. 
since $a|bc$ and $a\bot b$ doesn't $a$ has to divide $c$? I dont understand why do we need UFD?
Let $A$ be the ring of polynomials in $4$ variables $x,y,z,w$ with integer coefficients, and let $R$ be the quotient of $A$ by the ideal generated by $xy-zw$. $R$ is an integral domain, but not a UFD. $x$ and $z$ are relatively prime in $R$, and $x$ divides $zw$ in $R$ (because $zw$ is $xy$ in $R$), but $x$ doesn't divide $w$. 

A similar example can be produced in any non-UFD. If you have two factorizations into distinct irreducibles, $r=p_1p_2\cdots p_m=q_1q_2\cdots q_n$, you get $p_1$ relatively prime to $q_1$, $p_1$ divides $q_1(q_2\cdots q_n)$, $p_1$ doesn't divide $q_2\cdots q_n$.
Because if you had different factorizations or it weren't a domain, then it wouldn't be true.  Try $\mathbb{Z}_6$.  Then $5 |0 = 3*2$, but it doesn't divide 3 or 2.