If $p$ is prime, then for any integer $m$, $0 < m < p$, there is a unique $n$, $0 < n < p$, such that $mn$ is congruent to $1\pmod p$
Solving linear congruence (modular inverse or fraction) via gcd Bezout equation