For example, consider the congruence, for positive $x,y$
$$5^{y-10} = x5^{y-10} \bmod 64$$
Is it safe to divide both sides by $5^{y-10}$? Clearly if $y-10$ is non-negative, it will be coprime to 64 no matter what, but what about if $y-10$ is a negative number, implying an inverse?
Yes, if $y-10<0$ you can multiply both sides by $5^{10-y}$.