In most lectures about characteristic classes, I was told that we can always diagonalize the curvature 2-form. Here is an example from Nakahara's "geometry, topology and physics".

I admit we can diagonalize a unitary matrix, but since the curvature is a 2-form, it includes a set of matrices labeled by 2-form indexes $\mu\nu$, I don not think they can be diagonalized at the same time. Is it just a trick to get the formula (11.29) or we can actually compute the classes by this method. If so, can you show me how to diagonalize a curvature 2-form?
I think that the text from the book is a bit misleading (and in addition, there is a typo in the last but one line of the formula, where it should say $(x_1x_2\cdots x_k)$). I think the right explanation is that the identity $\det(I+A)=1+tr A+\frac12((tr A)^2-tr(A^2))+\dots+\det(A)$ is valid for arbitrary complex matrices. (It is not obvious either what the dots in the formula stand for, but that's a different cup of tea.) This is a fact from linear algebra, which can be proved by using that any complex matrix is similar to an upper triangular matrix, and trace and determinant remain unchanged if you replace $A$ by a similar matrix. This just generalizes the familiar fact that the determinant and the trace always equals the product of all eigenvalues and the sum of all eigenvalues, respectively. For Hermitian matrices, you can diagonalize instead of bringing to upper triangular form, but this does not change the argument.
You can then read this as an equality of invariant polynomials on $\mathfrak{su}(n)$ and thus use either of the two expression in computing characteristic classes.