I was trying to prove that $S^n$ is geodesically complete, which it is direct if I can prove that $S^n$ is compact. The problem is that I don't know how to do this. I know that every closed submanifold of an Euclidean space is complete and that $S^n$ is a closed submanifold of $\mathbb{R}^{n+1}$ because it is the inverse image of the regular value $0$ of the function $h: \mathbb{R}^{n+1} \longrightarrow \mathbb{R}$ defined by $h(x_1,\cdots,x_{n+1}) := \sum\limits_{i=1}^{n+1} x_i^2 - 1$. Therefore $S^n$ is complete as metric space and it is compact from Hopf-Rinow's theorem once that $S^n$ is a closed and bounded subset of itself, but how to prove that $S^n$ is compact if I don't consider an immersion of $S^n$ into $\mathbb{R}^{n+1}$?
Thanks in advance!
$\textbf{EDIT:}$
After some discussions on the comments, I am trying to be more specific about my doubt: how to prove that $S^n$ compact with respect to the natural topology of a smooth manifold, i.e., $A$ is an open subset of $M$ if $x_{\alpha}^{-1}(A \cap x_{\alpha}(U_{\alpha}))$ is an open set of $\mathbb{R}^n$ for each $\alpha$, where $x_{\alpha}: U_{\alpha} \subset \mathbb{R}^n \longrightarrow M$ are local charts of $M$? My doubt is because I don't know if this topology on $M = S^n$ agree with the subspace topology of $S^n$ inherited by the topology of $\mathbb{R}^{n+1}$. If these topologies agree, then this answer my question, but if it is not, then I can not see easily why $S^n$ is compact.