We can visualize the solution to $7x \equiv 1 \pmod{31}$ as the intersection of the two "lines"
$\ \ \ \ \ y \equiv 7x \pmod{31}$ and $y \equiv 1 \pmod{31}$.
The first line is closed under addition and subtraction, since it passes through the origin. If $(x_1, y_1)$ and $(x_2, y_2)$ are points on the line $y \equiv 7x \pmod{31}$, then so are $(x_1+x_2, y_1+y_2)$ and $(x_1-x_2, y_1-y_2)$.
To find a point where the lines intersect, we start with the two points $(1, 7)$ and $(0,31)$ on the first line, and repeatedly subtract one point from another until the $y$-coordinate is 1.
$\ \ \ \ \ (0,31) - (1,7) = (-1, 24)$
$\ \ \ \ \ (-1, 24) - (1,7) = (-2, 17)$
$\ \ \ \ \ (-2, 17) - (1, 7) = (-3, 10)$
$\ \ \ \ \ (-3, 10) - (1, 7) = (-4, 3)$
$\ \ \ \ \ (1,7) - (-4, 3) = (5, 4)$
$\ \ \ \ \ (5,4) - (-4, 3) = (9,1)$
Therefore, $x \equiv 9 \pmod{31}$.
You can speed up this procedure by subtracting a multiple of one point from another point instead. This leads to the Euclidean algorithm.