Let $S=\{x\in\mathcal{H}:\|x\|=1\}$. Since $S$ is closed and bounded, then $S$ is weakly compact.
But $T$ is compact. Then $T$ is weak-norm continous. Thus $f:H\to\mathbb{R}$ given by $f(x)=\|Tx\|$ is weak-continous. Since $H$ equipped with the weak topology is Hausdorff and $S$ is weakly compact, then $f$ attains a globlal maxima on $S$. That is, there is $x_0\in S$ such that $\|Tx_0\|\ge \|Tx\|$ for all $x\in S$.
Hence $\|Tx_0\|=\sup\{Tx:x\in S\}=\|T\|$ and done.
EDIT a simpler way
Moreover, note that if $T$ is compact and selfadjoint, it is simpler:
If $T=0$, done. Suppose $T\neq0$. Hence $\|T\|\neq0$
Let $\sigma(T)$ the spectrum of $T$. Since $T$ is continous, then $\|T\|\in\sigma(T)$.
Suppose $T$ is compact and selfadjoint. Then $\sigma(T)$ is discrete. Thus, only $0$ can be a limit point. Hence elements of $\sigma(T)$ are eigenvectors. In particular $\|T\|$ is an eigenvector. That is, $Tx=\|T\|x$ for some $x\in\mathcal{H}$.
Now, if $T$ is not selfadjoint, then $T=UA$ for some partial isometry and nonnegative $A$. Applying the above argument to $A$, done.