Consider the set of real numbers with the usual topology. These two sets $$[1/2,1]\cup[1/8,1/4]\cup[1/32,1/16]\cup...$$ $$\{1,2\}$$ I think the first one is closed but not connected, but I'm not sure if it is compact or not. By the definition of compact we have to find a finite subset but this is infinite.
For the second one, this includes two points, so it is open or close? I think it is not connected. And it is compact because it has finite elements. Not sure.
The first isn't closed because it doesn't contain one of its limit points: $0$. Indeed, $0$ is a limit point since no matter how much you zoom in, any neighbourhood of $0$ must overlap with some interval of the form $[\tfrac{1}{2^{2n+1}}, \tfrac{1}{2^{2n}}]$. The first is certainly not connected, and since it isn't closed, it follows by Heine-Borel that it isn't compact.
For the second one, it is indeed compact due to finiteness, and so by Heine-Borel must be closed. It is not connected because on the subspace topology, $\{1\}$ and $\{2\}$ form a separation of $\{1, 2\}$. For example, $\{1\}$ is open in $\{1, 2\}$ because $\{1\} = \{1, 2\} \cap (0.5, 1.5)$ and $(0.5, 1.5)$ is open in $\mathbb R$.