To solve this problem, you actually don't need to know the cone formula! This is simply the Pythagorean Theorem.
Using the theorem, which is a2+b2=c2 , we can insert our variables into the equation. Since c2 is the hypotenuse of the triangle, 12 will be our c.
h2+62=122
h2+36=144
144−36=h2
h2=108
h=√108=6√3
So, the height of the cone is 6√3 cm.
Hope this helps!
Doggo