Let $X$ be the total from rolling 6 fair dice, and let $X_1,\ldots,X_6$ be the individual rolls. What is $P(X=18)$? Then the PGF of $X$ is $$E(t^X) = E(t^{X_1} \cdots t^{X_6}) = \frac{t^6}{6^6}(1+t+ \cdots+t^5)^6$$ So the number of ways to get a sum of $18$ is the coefficient of $t^{18}$ in $t^6(1+t+\cdot\cdot\cdot+t^5)^6$, which is the coefficient of $t^{12}$ in $(1+t+\cdot\cdot\cdot+t^5)^6 $.
I don't understand why the coefficient of $t^{18}$ in $t^6(1+t+\cdot\cdot\cdot+t^5)^6$ is the same as the coefficient of $t^{12}$ in $(1+t+\cdot\cdot\cdot+t^5)^6 $?
the first one, you'll note, has $t^6$ glommed onto the beginning of its generating function; remove that, and you go from the coefficient of $t^{18}$ to that of $t^{18-6}=t^{12}$.