In reading this proof at PlanetMath: https://planetmath.org/acompactmetricspaceissecondcountable
Proposition. Every compact metric space is second countable.
Proof. Let $(X, d)$ be a compact metric space, and for each $n \in \mathbb{Z}^{+} \operatorname{define} \mathscr{A}_{n}=\{B(x, 1 / n): x \in X\}$, where $B(x, 1 / n)$ denotes the open ball centered about $x$ of radius $1 / n$. Each such collection is an open cover of the compact space $X$, so for each $n \in \mathbb{Z}^{+}$there exists a finite collection $\mathscr{B}_{n} \subseteq \mathscr{A}_{n}$ that $X$. Put $\mathscr{B}=\bigcup_{n=1}^{\infty} \mathscr{B}_{n}$. Being a countable union of finite sets, it follows that $\mathscr{B}$ is countable; we assert that it forms a basis for the metric topology on $X$. The first property of a basis is satisfied trivially, as each set $\mathscr{B}_{n}$ is an open cover of $X$. For the second property, let $x, x_{1}, x_{2} \in X, n_{1}, n_{2} \in \mathbb{Z}^{+}$, and suppose $x \in B\left(x_{1}, 1 / n_{1}\right) \cap B\left(x_{2}, 1 / n_{2}\right)$. Because the sets $B\left(x_{1}, 1 / n_{1}\right)$ and $B\left(x_{2}, 1 / n_{2}\right)$ are open in the metric topology on $X$, their intersection is also open, so there exists $\epsilon>0$ such that $B(x, \epsilon) \subseteq B\left(x_{1}, 1 / n_{1}\right) \cap B\left(x_{2}, 1 / n_{2}\right)$. Select $N \in \mathbb{Z}^{+}$such that $1 / N<\epsilon$. There must exist $x_{3} \in X$ such that $x \in B\left(x_{3}, 1 / 2 N\right)$ (since $\mathscr{R}_{2 N}$ is an open cover of $X$ ). To see that $B\left(x_{3}, 1 / 2 N\right) \subseteq B\left(x_{1}, 1 / n_{1}\right) \cap B\left(x_{2}, 1 / n_{2}\right)$, let $y \in B\left(x_{3}, 1 / 2 N\right)$. Then we have $$ d(x, y) \leq d\left(x, x_{3}\right)+d\left(x_{3}, y\right)<\frac{1}{2 N}+\frac{1}{2 N}=\frac{1}{N}<\epsilon, $$ so that $y \in B(x, \epsilon)$, from which it follows that $y \in B\left(x_{1}, 1 / n_{1}\right) \cap B\left(x_{2}, 1 / n_{2}\right)$, hence that $B\left(x_{3}, 1 / 2 N\right) \subseteq B\left(x_{1}, 1 / n_{1}\right) \cap B\left(x_{2}, 1 / n_{2}\right)$. Thus the countable collection $\mathscr{B}$ forms a basis for a topology on $X$; the verification that the topology by $\mathscr{B}$ is in fact the metric topology follows by an to that used to verify the second property of a basis, and completes the proof that $X$ is second countable.
Why is that induced topology the same as the metric topology? I only see that they are the base of some topology, not necessarily the metric topology.
Let $\mathscr{T}$ be the metric topology, and let $\mathscr{U}$ be the topology generated by the base $\mathscr{B}$. That $\mathscr{U}\subseteq\mathscr{T}$ follows immediately from the fact that $\mathscr{B}\subseteq\mathscr{T}$: every member of $\mathscr{U}$ is a union of members of $\mathscr{T}$. It remains to show that $\mathscr{T}\subseteq\mathscr{U}$.
Suppose that $V\in\mathscr{T}$. For each $x\in V$ there is a positive integer $n_x$ such that $B(x,1/n_x)\subseteq V$; let $m_x=2n_x$. $\mathscr{B}_{m_x}$ covers $X$, so $x \in B(y+x,1/m_x)$ for some $B(y_x,1/m_x)\in\mathscr{B}_{m_x}$. For any $z\in B(y_x,1/m_x)$, $$d(x,z)\le d(x,y)+d(y,z)<2/m_x=1/n_x,$$ so $x\in B(y_x,1/m_x)\subseteq B(x,1/n_x)\subseteq V$. It follows that $$V = \bigcup_{x\in V} B\left(y_x,\frac1{m_x}\right) \in \mathscr{U},$$ since the sets $\displaystyle B\left(y_x,\frac1{m_x}\right)$ all belong to $\mathscr{B}$.