The following is from Theorem 5.14 of John Lee's Introduction to Topological Manifolds.
Let $X$ be a CW complex. A subset of $X$ is compact if and only if it is closed in $X$ and contained in a finite subcomplex.
The proof for the only if direction is given as: suppose $K \subset X$ is compact. If $K$ intersects infinitely many cells, by choosing one point of $K$ in each such cell we obtain an infinite closed and discrete subset of $K$, which is impossible.
My question is why is this subset, say $A$, a closed subset of $K$? I think this is because $A'=\emptyset$, but I can't give a rigorous proof of this. I would greatly appreciate any help.