check the picture below.
so, a cone inscribed in a square pyramid, like the blue one there, will have the a diameter that is the length of the base of the pyramid, as you can see there, is 6, now, since the radius is half of the diameter, that means r = 3.
we know the slant height is 9, since the slant height and the height segment make a right-triangle with the base's segment, then we use the pythagorean theorem to get the height "h".
[tex]\bf \textit{volume of a cone}\\\\
V=\cfrac{\pi r^2 h}{3}\quad
\begin{cases}
r=radius\\
h=height\\
-----\\
r=3\\
h=6\sqrt{2}
\end{cases} \implies V=\cfrac{\pi (3)^2(6\sqrt{2})}{3}[/tex]