Group representation is semisimple iff restriction to subgroup of finite index is semisimple

This is Lemma 2.7 of The Local Langlands Conjecture for $\operatorname{GL}(2)$ by Henniart and Bushnell.

Let $U$ be a $G$-subspace of $V$. We need to show that $U$ has a $G$-stable complement. Since $U$ is $H$-stable, and $V$ is semisimple as a representation of $H$, there exists an $H$-stable complement $U'$ of $U$, so $V = U \oplus U'$. Let $p: V \rightarrow U$ be the projection onto $U$. This is an $H$-linear map. Let $g_1, ... , g_n$ be left coset representatives of $H$ in $G$, and define a map $p^G: V \rightarrow U$ by

$$p^G(v) = \frac{1}{n} \sum\limits_{i=1}^n \pi(g_i)p(\pi(g_i)^{-1}v)$$

This is clearly a linear transformation. It is also straightforward to check that it is $G$-linear, and idempotent. Hence $V$ is the direct sum of $U$ and $\operatorname{Ker}(p^G)$, both $G$-subspaces.