I'm not fully convinced by the following proof, which you can find in Alexandrino, Bettiol - Lie Groups and Geometric Aspects of Isometric Actions. The result is the following
Let $G$ be a compact and connected Lie group with Lie algebra $\mathfrak g$. Choose a maximal abelian subalgebra $\mathfrak t$ and a maximal torus $T$ such that $\mathrm{Lie}(T)=\mathfrak t$. If $X\in \mathfrak t$ is an infinitesimal generator of the torus, that is, if $\overline{\{\exp tX: t \in \mathbf R\}}=T$, then $\mathfrak t$ is characterised as $$ \mathfrak t=\{Y \in \mathfrak g : [X, Y]=0\}.$$
Proof: "$\subset$" is obvious. As for "$\supset$", suppose $Y \in \mathfrak g$ is such that $[X, Y]=0$. Then $$ \exp sX \exp tY= \exp tY \exp sX$$ for all $s, t \in \mathbf R$ [fine], hence $\exp(tY)$ commutes with all elements of $\overline{\{\exp sX: s \in \mathbf R\}}=T$ [fine], therefore $Y$ commutes with all elements of $\mathfrak t$ [why??]. Now form the Lie subalgebra $\mathfrak t'= \mathfrak t \oplus \mathrm{span}(Y)$ [then we will find that $Y \in \mathfrak t$, so in my opinion the notation here is wrong, one should have written $\mathfrak t'= \mathrm{span}(\mathfrak t, Y)$, but this is not a big deal], and consider the unique connected Lie subgroup $T'$ of $G$ such that $\mathrm{Lie}(T')=\mathfrak t'$; its closure $\overline T'$ is a torus containing $T$, hence $T=\overline T'$ and $\mathfrak t = \mathfrak t'$ and $Y \in \mathfrak t$.
Now the main thing is that passage where I've written "why??" in square brackets. I can not see why we can infer that. Besides, provided that at that point we have proven that $Y$ commutes with all $\mathfrak t$, I would proceed in the following (maybe simpler?) way: consider the vector space $\mathfrak t'=\mathrm{span}(Y, \mathfrak t)$. Since we have proven that $Y$ commutes with all $\mathfrak t$, this is an abelian Lie subalgebra of $\mathfrak g$ and contains $\mathfrak t$, hence by maximality of $\mathfrak t$ we have $Y \in \mathfrak t$.
What do you think?