This is a recursive method, simple to do by hand for small matrices but inefficient for larger matrices:

The minor is the determinant of a sub-matrix obtained by omitting the row and column .

Link to original

is called the cofactor.

For example:

First choose a row (), preferrably one with many being zero. in this case.
Create minor matrices by crossing out row and columns :

\begin{bmatrix} 
\square & 2 & 3 \\ 
\square & \square & \square \\  
\square & 8 & 9
\end{bmatrix}
\rightarrow 
\begin{vmatrix} 2 & 3 \\ 8 & 9 \end{vmatrix}
= m_{2,1}
Link to original

Multiply the determinant of each minor by the corresponding element of the original matrix :

Now we see the benefit of choosing the row with the most zeros.

Should there be more zeros in a col rather than a row, you can simply flip for (make the chosen col static and loop over the rows).

If you have bigger than matrices, apply the process recursively, i.e. split the matrices until you get to matrices.