How does one solve questions of $ax+b$ (mod n) = $cx+d$ (mod n) form?

I know that if $b,d$ are $0$ then, I can take multiples of $n$ as solutions for x.

but what if $b,n$ are not zero? 

Under what conditions do solutions exist?