I was trying to answer exercise 9 of $ I.5. $ from Einstein gravity in a nutshell by A. Zee that I saw this question so what I am going to say is from this question. It is said that the d-dimensional unit sphere $S^d$ is embedded into $E^{d+1}$ by usual Pythagorean relation$$(X^1)^2+(X^2)^2+.....+(X^{d+1})^2=1$$. Thus $S^1$ is the circle and $S^2$ the sphere. A. Zee says we can generalize what we know about polar and spherical coordinates to higher dimensions by defining
$X^1=\cos\theta_1\quad X^2=\sin\theta_1 \cos\theta_2,\ldots $
$X^d=\sin\theta_1 \ldots \sin\theta_{d-1} \cos\theta_d,$
$X^{d+1}=\sin\theta_1 \ldots \sin\theta_{d-1} \sin\theta_d$
where $0\leq\theta_{i}\lt \pi \,$ for $ 1\leq i\lt d $ but $ 0\leq \theta_d \lt 2\pi $.
So for $S^1$ we just have ($\theta_1$):
$X^1=\cos\theta_1,\quad X^2=\sin\theta_1$
$S^1$ is embedded into $E^2$ and for the metric on $S^1$ we have: $$ds_1^2=\sum_1^2(dX^i)^2=d\theta_1^2$$
for $S^2$ we have ($\theta_1, \theta_2$) so for Cartesian coordinates we have:
$X^1=\cos\theta_1,\quad X^2=\sin\theta_1\cos\theta_2,$ $\quad X^3=\sin\theta_1\sin\theta_2$
and for its metric: $$ds_2^2=\sum_1^3(dX^i)^2=d\theta_1^2+\sin^2\theta_1 d\theta_2^2$$
for $S^3$ which is embedded into $E^4$ we have($ \theta_1,\theta_2,\theta_3 $):
$X^1=\cos\theta_1,\quad X^2=\sin\theta_1\cos\theta_2,$ $\quad X^3=\sin\theta_1\sin\theta_2\cos\theta_3 $$\quad X^3=\sin\theta_1\sin\theta_2\cos\theta_3$ $X^4=\sin\theta_1\sin\theta_2\sin\theta_3 $$\quad X^4=\sin\theta_1\sin\theta_2\sin\theta_3 $
$$ds_3^2=\sum_{i=1}^4(dX^1)^i=d\theta_1^2+\sin^2\theta_1 d\theta_2^2+sin^2\theta_1\sin^2\theta_2\,d\theta_3^2$$
Finally, it is not difficult to show the metric on $S^d$ will be:
$$ds_d^2=\sum_{i=1}^{d+1}(dX^1)^i=d\theta_1^2+\sin^2\theta_1 d\theta_2^2+sin^2\theta_1\sin^2\theta_2\,d\theta_3^2+\cdots+sin^2\theta_1\cdots\sin^2\theta_{d-1}\,d\theta_d^2$$