Compactness comes a little later. Note that there are two definitions of compactness that might benefit you in this case. Given a collection of closed sets with the finite intersection property, their intersection is nonempty (this is equivalent to the normal definition of compactness).
Anyway, you know that the complement of an open set is closed, and a closed subset of a compact space is compact. So, is compact. Additionally, is totally disconnected, so any cover of by open sets can be reduced to a finite subcover. Total disconnectedness means that every nontrivial subset of is not connected. That will be useful to finding clopen subsets. The intersection of closed sets remains closed, but only the intersection of finitely many open sets remains open. So, be careful when intersecting clopen sets.
Disclaimer: It has been years since I have done this problem, so I do not recall off the top of my head all the steps I took to solve it. I am not sure if the alternate definition of compactness was useful in this proof. Also, I seem to recall a picture that looked like an atlas. Each clopen subset of X is a totally disconnected compact space. So, I cut up X into "states", then I cut up each state into "counties", etc. (At least, that's how the picture looked to me).