Think about what happens if you exand a determinant by its first row: the determinant is each member of that row by its "cofactor", the determinant made by removing the row and column that member is in from the matrix, with a factor of 1 or -1 depending on the exact position. If you construct your matrix B having those cofactors in the first column, multiplying the two matrices will give you exactly the determinant in the "first row first column" position.

Argue in the same way for the second column of the new matrix, etc.