The strategy is to show $gK = Kg$ for all $g \in G$ by considering two cases: $g \in K$ and $g \notin K$.
**Step 1: $g \in K$.**
If $g \in K$, then $gK = K = Kg$ (since the coset of an element of $K$ is $K$ itself).
**Step 2: $g \notin K$.**
Since $|G : K| = 2$, there are exactly two left cosets of $K$ in $G$: the subgroup $K$ itself and one other. Since $g \notin K$, the left coset $gK \neq K$, so the partition of $G$ into left cosets is:
\begin{align*}
G = K \;\dot\cup\; gK.
\end{align*}
The identical argument for right cosets gives:
\begin{align*}
G = K \;\dot\cup\; Kg.
\end{align*}
Since $K$ and $gK$ are disjoint, and $K$ and $Kg$ are disjoint, and both unions equal $G$, it follows that $gK = G \setminus K = Kg$.
**Step 3: Conclude.**
In both cases $gK = Kg$, so $K \unlhd G$.