Notation, complementary minors and adjoint matrix
Write a $2\times2$ matrix and its determinant (only writing, no need to compute it). Then do the same for a $3\times3$ matrix.
If we write the $2\times2$ matrix, $\left(\begin{matrix} 1 & -1\\ 2 & 1 \end{matrix}\right)$ the determinant is written $\left|\begin{matrix} 1 & -1\\ 2 & 1 \end{matrix}\right|$
And the same for the $3\times3$ case $$\left(\begin{matrix} 1 & 0 & 0 \\ 1 & 1 & 0 \\ 0 & 1 & 1 \end{matrix}\right) \rightarrow \left|\begin{matrix} 1 & 0 & 0 \\ 1 & 1 & 0 \\ 0 & 1 & 1 \end{matrix}\right|$$
The determinant is written $\left|\begin{matrix} 1 & -1\\ 2 & 1 \end{matrix}\right|$ and $\left|\begin{matrix} 1 & 0 & 0 \\ 1 & 1 & 0 \\ 0 & 1 & 1 \end{matrix}\right|$
Find the complementary minor of every element of the main diagonal of the following $4\times4$ matrix $$\left(\begin{matrix} 1 & 0 & 1 & 0 \\ 1 & 1 & 0 & 2 \\ 1 & 1 & 1 & 0 \\ 1 & 2 & 3 & 1 \end{matrix}\right)$$
We have to find the complementary minors of the elements of the main diagonal, that is, of the elements $a_{11}, a_{22}, a_{33}, a_{44}$.
$$a_{11}=\left(\begin{matrix} \xcancel{1} & \cancel{0} & \cancel{1} & \cancel{0} \\ \bcancel{1} & 1 & 0 & 2\\ \bcancel{1} & 1 & 1 & 0 \\ \bcancel{1} & 2 & 3 & 1 \end{matrix}\right)=\begin{matrix} \left|\begin{matrix} 1 & 0 & 2 \\ 1 & 1 & 0\\ 2 & 3 & 1 \end{matrix}\right| \\ \begin{matrix} 1 & 0 & 2 \\ 1 & 1 & 0 \end{matrix}\end{matrix}=$$ $$=1\cdot1\cdot1+1\cdot3\cdot2+\cancel{2\cdot0\cdot0}-2\cdot1\cdot2-\cancel{0\cdot3\cdot1}-\cancel{1\cdot0\cdot1}=1+6-4=3$$
Using the formula of Sarrus to calculate the determinant $3\times3$.
The rest of minors must be calculated in the same way
$$a_{22}=\left(\begin{matrix} 1 & \cancel{0} & 1 & 0 \\ \bcancel{1} & \xcancel{1} & \bcancel{0} & \bcancel{2}\\ 1 & \cancel{1} & 1 & 0 \\ 1 & \cancel{2} & 3 & 1 \end{matrix}\right)=\left|\begin{matrix} 1 & 1 & 0 \\ 1 & 1 & 0\\ 1 & 3 & 1 \end{matrix}\right| = 0 $$ (since there are repeated rows)
$$a_{33}=\left(\begin{matrix} 1 & 0 & \cancel{1} & 0 \\ 1 & 1 & \cancel{0} & 2\\ \bcancel{1} & \bcancel{1} & \xcancel{1} & \bcancel{0} \\ 1 & 2 & \cancel{3} & 1 \end{matrix}\right)=\left|\begin{matrix} 1 & 0 & 0 \\ 1 & 1 & 2\\ 1 & 2 & 1 \end{matrix}\right| =$$ $$=1\cdot1\cdot1+1\cdot2\cdot0+1\cdot0\cdot2-0\cdot1\cdot1-2\cdot2\cdot1-1\cdot0\cdot1=-3$$
$$a_{44}=\left(\begin{matrix} 1 & 0 & 1 & \cancel{0} \\ 1 & 1 & 0 & \cancel{2}\\ 1 & 1 & 1 & \cancel{0} \\ \bcancel{1} & \bcancel{2} & \bcancel{3} & \xcancel{1} \end{matrix}\right)=\left|\begin{matrix} 1 & 0 & 1 \\ 1 & 1 & 0\\ 1 & 1 & 1 \end{matrix}\right| =$$ $$=1\cdot1\cdot1+1\cdot1\cdot1+1\cdot0\cdot0-1\cdot1\cdot1-0\cdot1\cdot1-1\cdot0\cdot1=1$$
$$a_{11}=3, a_{22}=0, a_{33}=-3, a_{44}=1$$
Find the adjoint matrix $$A=\left(\begin{matrix} 1 & 0 & 2 \\ 0 & 3 & 1 \\ 3 & 1 & 0 \end{matrix}\right)$$
We have to find $adj(A)$. The first step is to calculate all the complementary minors.
$$a_{11}=\left|\begin{matrix} \xcancel{1} & \cancel{0} & \cancel{2} \\ \bcancel{0} & 3 & 1\\ \bcancel{3} & 1 & 0 \end{matrix}\right| = \left|\begin{matrix} 3 & 1 \\ 1 & 0 \end{matrix}\right| = -1$$
$$a_{12}=\left|\begin{matrix} 0 & 1 \\ 3 & 0 \end{matrix}\right| = -3$$
$$a_{13}=\left|\begin{matrix} 0 & 3 \\ 3 & 1 \end{matrix}\right| = -9$$
$$a_{21}=\left|\begin{matrix} 0 & 2 \\ 1 & 0 \end{matrix}\right| = -2$$
$$a_{22}=\left|\begin{matrix} 1 & 2 \\ 3 & 0 \end{matrix}\right| = -6$$
$$a_{23}=\left|\begin{matrix} 1 & 0 \\ 3 & 1 \end{matrix}\right| = 1$$
$$a_{31}=\left|\begin{matrix} 0 & 2 \\ 3 & 1 \end{matrix}\right| = -6$$
$$a_{32}=\left|\begin{matrix} 1 & 2 \\ 0 & 1 \end{matrix}\right| = 1$$
$$a_{33}=\left|\begin{matrix} 1 & 0 \\ 0 & 3 \end{matrix}\right| = 3$$
To calculate the adjugate matrix we must bear in mind the signs!
$$\left(\begin{matrix} + & - & + \\ - & + & - \\ + & - & + \end{matrix}\right)$$ And finally, $$adj(A)=\left(\begin{matrix} -1 & 3 & -9 \\ 2 & -6 & -1 \\ -6 & -1 & 3 \end{matrix}\right)$$
$$adj(A)=\left(\begin{matrix} -1 & 3 & -9 \\ 2 & -6 & -1 \\ -6 & -1 & 3 \end{matrix}\right)$$