I see a redundancy in the following proof of the statement. First, we have a lemma that this proof uses
A subspace $A \subseteq X$ is compact if and only if every open cover of $A$ by open subsets of $X$ has a finite subcover.
Now the proof
Let $X$ be compact and $A \subseteq X$ be closed. Let $(U_i)_{i \in I}$ be a cover of $A$ by open subsets of $X$. Then $(U_i)$ together with $X \setminus A$ is an open cover of $X$. Since $X$ is compact, it has some finite subcover, $J \subseteq I$ that is finite such that
$$(X\setminus A) \cup \left(\bigcup_{j \in J} U_j\right)=X$$
Then $A \subseteq \bigcup_{j \in J} U_j$ and by the lemma, we have $A$ to be compact.
Now, I think I can shorten this as follows
Let $X$ be compact and $A \subseteq X$ be closed. Let $(U_i)_{i \in I}$ be a cover of $A$ by open subsets of $X$. Since $X$ is compact, there exists some finite $J \subseteq I$ such that $\bigcup U_j=X$. Since $A \subseteq X$, we clearly have $A \subseteq \bigcup_{j \in J} U_j$ as required.
Well..? Why do we need to consider the complement $X\setminus A$? Why put that in the finite open cover that we already have? Shouldn't $\bigcup U_j$ suffice on its own as a finite open cover of $A$ anyway? I do't see the role of $X\setminus A$ at all in the proof. can someone explain?