We may use computation modulo $10$ as an example.
The numbers $a$ that are not prime to $10$ are the even numbers, and the multiples of $5$. An inverse of $a$ modulo $10$ is any number $a'$ such that $a a' \equiv 1 \pmod{10}$; or, $aa'$ ends with the digit $1$.
Now, do you see why for an even number $a$, it is impossible to find $a'$ such that $aa'$ ends with $1$ ? And for $a$ multiple of $5$ ?
This generalizes nicely to a proof of: if $d=\gcd(a,m) \neq 1$, then $a$ is not invertible modulo $m$; namely, for any $a'$, $d$ divides both $aa'$ and $m$, and therefore, for any $a'$ and $t$, $aa' - t m$. This implies that $aa' - t m$ will always be $\neq 1$; or, that $aa' \not \equiv 1 \pmod{m}$.
For the converse direction, it is a bit less obvious but not harder. Namely, you should by now know the Bézout identity: namely, if $d = \gcd (a,m)$, then there exist $a', m'$ such that $aa' + mm' = d$. If $d = 1$, then this immediately means that $aa' \equiv 1 \pmod{m}$.