The set $\{ 1,2, \dots , p-1\}$
is a restricted set of residues $\mod p$.
If $a$ is any element of this set,then:
$\{ a,2a, \dots, (p-1)a \} \ $
is also a restricted set of residues $ \ \mod p$.
So,exactly one element of the second set is equivalent $\mod p$ to $1$.
So,we have shown that for each $a \in \{ 1, \dots, p-1\}$ there is exactly one $b \in \{ 1, \dots, p-1 \}$ such that:
$$ab \equiv 1 \pmod p$$
Now we check if it can be $a=b$.
This is equivalent to:
$$a^2 \equiv 1 \pmod p \Leftrightarrow p \mid a^2-1 \Leftrightarrow p \mid a-1 \text{ or } p \mid a+1 \Leftrightarrow a=1 \text{ or } a=p-1$$
We conclude that for each $a \in \{ 2, \dots, p-2 \}$ there is exactly one $b \in \{ 2, \dots, p-2\}$ so that:
$$ab \equiv 1 \pmod p, \ a\neq b$$
So,the numbers $2, \dots,p-2$ can be seperated into $\frac{p-3}{2}$ pairs,so that the product of the two numbers of each pair is equivalent $\pmod p$ to $1$,and therefore:
$$2 \cdots (p-2) \equiv 1 \pmod p$$
Therefore:
$$(p-1)! = 1 \cdot 2 \cdots (p-2) \cdot (p-1) \equiv 1 \cdot 1 \cdot (p-1) \equiv -1 \pmod p$$