If I start with an $SU(5)$ gauge group and discover that the vacuum is preserved only by matrices of the form $G$ $$\begin{bmatrix} A & 0 \\ 0 & B \\ \end{bmatrix}$$ where the conditions on $A$ and $B$ ($A$ is a $3\times 3$ matrix and $B$ a $2\times 2$) are: that they must be Hermitian, and the matrix $G$ is traceless.
I don't understand why, if $tr(A)=−tr(B)$, then I have $U(1)$ and if I take $trA = trB = 0$ it is $SU(3)\times SU(2)$, so it means $SU(3)\times SU(2)\times U(1)$.