I understand that the definition of compactness varies. I am wanting to prove the set $[a,b]$ is compact the following way just like Julien did here for an answer. This proof is also similarly set up on p. 42 of Royden (second edition) for Real Analysis. There are many proofs of this result which all use the same trick which I am having a difficult time with.
I am going to start to the proof and explain where I am getting hung up.
$\textbf{Proof:}$ Let $[a,b]$ be a set of real numbers where we will assume $a<b$. Let $\lbrace U_i\rbrace_{i\in I}$ be an arbitrary collection of open sets that is an arbitrary open cover of $[a, b]$. Then, by definition, we know $[a,b]\subseteq \bigcup_{i\in I} U_i$. Now, we need to show there exists a finite collection $\lbrace U_1, U_2, ..., U_k\rbrace$ (i.e. a finite collection whose objects are open sets in the set $\lbrace U_i\rbrace_{i\in I}$) such that $[a,b]\subseteq \bigcup_{j=1}^kU_j$.
What I am confused on now is why does everyone define the set $S=\lbrace x\in [a,b]|[a,x]\subseteq \bigcup_{\text{C is a finite subset of I}} \lbrace U_c \rbrace_{c\in C}\rbrace$ after this part?
I do not see how the set $S$ here resembles a finite collection of open sets $\lbrace U_1, U_2, ..., U_k\rbrace$ like I was trying to show with the whole subset thing. Why do we want to show $LUB(S)=b$ (i.e. the least upper bound of the set $S$) do? I get lost at this part in the proof as to what we are trying to show.