This is false, so don't feel bad you cannot prove it.
One of the standard non-finite counterexamples is below, it's mostly to illustrate that the problem is more systematic than just the trivial, finite ones. In particular, it starts with a Hausdorff group rather than what some might consider cheating by endowing the original group with a non-Hausdorff topology. From this it constructs a non-closed--but still finite-index--subgroup, so that the quotient space has a non-Hausdorff topology (which is equivalent to the original subgroup being non-closed).
Consider the finite group $A=\Bbb Z/2\Bbb Z$, endowed with the discrete topology. (Note that there are four topologies on a $A$, and that only two of them (the discrete one and the coarsest one) are turning it into a topological group, and only one of them (the discrete one) turns it into a compact topological group.)
Construct the group
$$G=A^\Bbb Z=\prod_{n\in\Bbb Z} A$$
This is compact by Tychonoff's theorem, and manifestly a group. Now from here we let $\tau$ be the topology generated by an ultrafilter, $\mathcal{F}$, containing the Fréchet filter. Let $H\le G$ be defined by the fact that Let $\pi_n(g)=g_n$ be the $n^{th}$ coordinate map, and
$$h\in H\iff |\{n\in\Bbb Z : \pi_n(h)=1\}|\in\{0,\infty\}.$$
$H$ is also dense in $G$ because the Fréchet filter is cofinite in the powerset of $\Bbb Z$, but clearly also $H\ne G$. Then distinguish two special elements, $\mathbf{0},\mathbf{1}\in G$, defined by the rules
$$\begin{cases}\pi_n(\mathbf{0}) =0 & n\in\Bbb Z \\ \pi_n(\mathbf{1})=1 & n\in\Bbb Z\end{cases}$$
Now let $g\in G$ be arbitrary and define sets $S_0, S_1$ by the rule
$$S_i = \{n\in\Bbb Z : g_i=n\}$$
So that $\Bbb Z=S_0\coprod S_1$ since $g_i\in\{0,1\}$. Then we see one of the $S_i\in\mathcal{F}$ by maximality. So $g\equiv x\mod H$ for some $x\in\{\mathbf{0},\mathbf{1}\}$, i.e. $[G:H]\le 2$. Since $H\ne G$, clearly $[G:H]=2$, but $H$ is dense, hence cannot be closed, and since closed + finite index = open, it must be that $H$ is not open, despite being finite index.
The key problem: we chose a non-Hausdorff topology on the quotient, $G/H$, i.e. we took only the trivial topology $\tau=\{\varnothing, G/H\}$. It is classical that $G/H$ Hausdorff iff $H$ is closed (provided $G$ is Hausdorff), so this was the natural approach to producing a non-closed subgroup of finite index. The algebra still allows two cosets, but the topology doesn't allow you to force them apart.
Edit: An even easier counterexample is just $G=\Bbb Z/2\Bbb Z$ with the trivial topology. Then $\{e\}\le G$ is not open, but clearly has finite index.
Edit 2: Since the op is using the convention that "compact" means "Hausdorff + finite subcovers" I moved the first edit to the bottom.