By what rule or property this expression is equal to six? $$2^{-1} \equiv 6\mod{11}$$

Sorry for very strange question. I want to understand on which algorithm there is a computation of this expression. Similarly interested in why this expression is equal to two?

$$6^{-1} \equiv 2\mod11$$
It's because $2\cdot 6 \equiv 1 \mod 11$
It is part of the collection of integer pairs such that:

$$xy\equiv1\mod p$$

in this case with $p=11$.

For $p=11$, they are $1\cdot1,2\cdot6,3\cdot4,5\cdot9,7\cdot8$ and $10\cdot10$

Except for $1$ and $p-1$, each $x$ is paired to a unique $y$.