I'm trying to find a way to find the character $\chi = n_+ - n_-$ of real forms of Lie algebras. Here $n_+$ and $n_-$ are the number of positive, negative eigenvalues of the Cartan Killing metrc respectively. For example I want to find $\chi$ for $\mathfrak{su}(p,q)$, $\mathfrak{su}^*(2n)$, $\mathfrak{so}^*(2n)$ and the like. My first idea was to look for the maximal compact subalgebra which would then give $n_-$ since this is the unique one where $n_+ = 0$. Hence, if we know the dimension of the maximal compact subalgebra, we get $n_-$.
But I'm stuck here. How do I find $n_+$? And how do I even find the maximal compact subalgebra for a given Lie algebra and its dimension?
$\textbf{EDIT:}$ I also noticed that if we have the dimension of the real form, then we necessarily have $n_+$ too, since $n = n_+ + n_-$. So my question boils down to 1) How do I find the maximal compact subalgebras? 2) How can I easily know the dimensions?