I know a subgroup $T$ of $K$ is a torus if $T$ is isomorphic to $(S^1)^k$ for some $k$ (while in some other literature, such that Lie Groups by Bump, compact torus is a compact connected Lie group that is abelian), and a subgroup $T$ of $K$ is a maximal torus if it is a torus and is not properly contained in any other torus in $K$. Now I have a problem with how to compute the maximal torus.
In Lie Groups, for $G=U(n)$, Bump states directly that its maximal torus is (see Example 15.1) $$T=\{\mathrm{diag}(t_1,\cdots,t_n)\mid |t_1|=\cdots=|t_n|=1\}.$$ I'm able to verify it as follows. Assume that $T$ is contained in another torus $S\in U(n)$. Then every element $s\in S$ would commute with every element $t$ of $T$. If $t$ have distinct eigenvalues, then $s$ would have to be of the form $T$. Hence $T=S$, i.e., $T$ is indeed s maximal torus.
But if I didn't know what the form a maximal torus is, that is, I can't verify a maximal torus as above, how can I compute or find it? Or should I remember some common maximum torus or directly guess its form and then verify it?
Note this is a maximal torus not the only one. There is a whole conjugacy class of them.
A key feature of a torus in a semisimple/reductive group though is that it comprises semisimple elements (i.e. diagonalisable over the algebraic closure). So you can often find a maximal torus as simply the diagonal subgroup. Of course that doesn't always work and the standard presentation of $SO(n,\mathbb{C})$ for example doesn't allow this, but it is not too hard to either adapt to those cases or alternatively change your presentation of the group to ensure there is a diagonal torus.
In that example, the former approach yields a torus comprised of block diagonal matrices with blocks $$\begin{pmatrix}\cos \theta & -\sin \theta \\\sin \theta & \cos\theta \end{pmatrix}$$
while the latter requires changing $SO(n,\mathbb{C})$ to be the group preserving, say, the bilinear form given by $$\begin{pmatrix}0 & I \\I & 0 \end{pmatrix}$$ for $n$ even or $$ \begin{pmatrix}1&0&0 \\0 & 0 & I \\0 & I & 0 \end{pmatrix}$$ for $n$ odd. In this setup there is now a diagonal torus.