You need to find the inverse of $53\equiv 22$ modulo $31$. To do it, you may use the Euclidean algorithm. ote you can also look at this as a $$\begin{pmatrix}7&9\\2&-5\end{pmatrix}\begin{pmatrix}x\\y\end{pmatrix}=\begin{pmatrix}0\\2\end{pmatrix}$$
Note that $$\det\begin{pmatrix}7&9\\2&-5\end{pmatrix}=-53\equiv 9$$
But $9\times 7=63\equiv 1$ so
$$\begin{pmatrix}x\\y\end{pmatrix}=7\begin{pmatrix}-5&-9\\-2&7\end{pmatrix}\begin{pmatrix}0\\2\end{pmatrix}=\begin{pmatrix} 29\\23\end{pmatrix}$$
That is, one can work as usual using Cramer's rule as long as $\det A\not \equiv 0$ modulo what you're working in.