Let $\mathcal{B}$ be a countable base for the topology of $X$, and let $K\subseteq X$ be a compact. We have that $X$ is Hausdorff, so for each $x\in K^c$ and $y\in K$, there is an open $U_{xy}$ such that $y\in U_{xy}$ but $x\notin U_{xy}$. Moreover, there exists $V_xy \in \mathcal{B}$ such that $y\in V_{xy}\subseteq U_{xy}$
Since $K$ is compact, for each $x\in K^c$ there is a finite set $Y_x \subseteq K$ such that,
$$K\subseteq \bigcup_{y\in Y_x} V_{xy} \qquad (*)$$
We have,
$$K=\bigcap_{x\in K^c}\left(\,\bigcup_{y\in Y_x}V_{xy} \right)$$
since $x\notin V_{xy}$ for all $x\in K^c$ and $y\in Y_x$.
Since the set,
$$\left\{ \bigcup_{U\in \mathcal{A}} U : \mathcal{A}\subseteq \mathcal{B} \text{ is finite}\right\}$$
is a countable collection of open sets, to demonstrate this, just prove that the set of all finite subsets of $\mathbb{N}$ is countable.
Therefore the intersection in (*) is countable, because, although the intersection is indexed by a possible uncontable quantity, there is only an countable number of distinct sets, by the previous result.
This shows that $K$ is $G_\delta$.