I’m not sure why there is a negative infront of the “b” so I wouldn’t know how to translate this to even higher dimension matrices. An excerpt of the explanation I’m looking at is below.
First, we select a row or column. For the first value in that row, we “hide” the other values in that row and in that column, select the rest of the elements as the minor matrix, and multiply the scalar value with the determinant of the minor matrix. We repeat this for the remaining values in the first row. This diagram helps illustrate this much clearer: