The minor of a determinant is created by deleting all elements in the same row or column as the selected element:
|(5,4,color(red)(cancel(color(black)2))),
(color(red)(cancel(color(black)(1))),color(red)(cancel(color(black)(7))),color(red)(cancel(3))),
(4,-1,color(red)(cancel(color(black)(1))))|
=|(5,4),(4,-1)|
The co-factor of a determinant is created by multiplying the minor by (-1)^(r+c) where r is the row number of the selected element and c is the column number of the selected element.
In this case color(red)(3) is in row 2 column 3.
(The top left is always row 1, column 1)
So for this example
color(white)("XXX")(-1)^(r+c)=(-1)^(2+3)=(-1)^5=-1
and the co-factor is
color(white)(""XXX")-1 * |(5,4),(4,-1)|