A useful mnemonic to remember the expression for the determinant is "A Hot Girl Had Beautiful Face, Go For Chocolates":
\(a(bc - f^2)\)
\(-h(hc - fg)\)
\(+g(hf - bg)\)
Another way is to remember the phrase: "All handsome guys having beautiful faces go for coffee", which helps to set up the matrix \(\begin{pmatrix} a & h & g
h & b & f
g & f & c \end{pmatrix}\).