$\DeclareMathOperator\GL{GL}\DeclareMathOperator\SO{SO}\DeclareMathOperator\Sp{Sp}\DeclareMathOperator\ad{ad}\DeclareMathOperator\Ad{Ad}$Let $G\subset \GL_n(\mathbb{C})$ be a complex matrix Lie group, (e.g., $\SO_n$, $\Sp_{n}$), and let $x\in G$ with Jordan form $u$ ($u$ may not belong to $G$) given, I wonder how to compute the centralizer $Z_{G}(x)$.

I know the Lie algebra of $Z_{G}(x)$ is $\{Y\in \mathfrak{g}\mid \Ad(x)Y=Y\}$. But it's hard for me to find a matrix $t\in \GL_n(\mathbb{C})$ such that $tut^{-1}\in G$. I tried to find $U\in \mathfrak{gl}_n(\mathbb{C})$ such that $\exp(U)=u$ and then find a $T\in \mathfrak{gl}_n(\mathbb{C})$ such that $\ad(T)(U)\in \mathfrak{g}$, but I don't think that means $\exp(T)u(\exp(T))^{-1}\in G$.

Any help will be appreciated.