[step:Choose Killing-dual bases adapted to the root decomposition]
Let $r:=\dim_{\mathbb C}\mathfrak h$, and choose a basis $(h_1,\dots,h_r)$ of $\mathfrak h$. Let $(k_1,\dots,k_r)$ be the $B$-[dual basis](/theorems/414) of $\mathfrak h$, so that
\begin{align*}
B(h_i,k_j)=\delta_{ij}
\end{align*}
for all $1\le i,j\le r$.
Let $\Phi:=\Phi^+\cup(-\Phi^+)$ be the full root system.
For each root $\alpha\in\Phi$, write
\begin{align*}
\mathfrak g_\alpha:=\{x\in\mathfrak g:[h,x]=\alpha(h)x\text{ for every }h\in\mathfrak h\}
\end{align*}
for the corresponding root space. The root-space theorem for finite-dimensional complex semisimple Lie algebras gives
\begin{align*}
\dim_{\mathbb C}\mathfrak g_\alpha=1
\end{align*}
for every $\alpha\in\Phi$ and the direct-sum decomposition
\begin{align*}
\mathfrak g=\mathfrak h\oplus\bigoplus_{\alpha\in\Phi}\mathfrak g_\alpha.
\end{align*}
The Killing form is orthogonal on root spaces unless the roots sum to zero: if $x\in\mathfrak g_\alpha$ and $y\in\mathfrak g_\beta$, invariance gives
\begin{align*}
(\alpha+\beta)(h)B(x,y)=B([h,x],y)+B(x,[h,y])=0
\end{align*}
for every $h\in\mathfrak h$, so $B(x,y)=0$ when $\alpha+\beta\ne 0$. Nondegeneracy of $B$ on $\mathfrak g$ therefore pairs each one-dimensional $\mathfrak g_\alpha$ nondegenerately with $\mathfrak g_{-\alpha}$.
For each $\alpha\in\Phi^+$, choose a nonzero vector $e_\alpha\in\mathfrak g_\alpha$. Since the Killing form pairs $\mathfrak g_\alpha$ nondegenerately with $\mathfrak g_{-\alpha}$, choose $f_\alpha\in\mathfrak g_{-\alpha}$ such that
\begin{align*}
B(e_\alpha,f_\alpha)=1.
\end{align*}
Then
\begin{align*}
(h_1,\dots,h_r,(e_\alpha)_{\alpha\in\Phi^+},(f_\alpha)_{\alpha\in\Phi^+})
\end{align*}
is a basis of $\mathfrak g$ adapted to the decomposition
\begin{align*}
\mathfrak g=\mathfrak h\oplus\bigoplus_{\alpha\in\Phi^+}\mathfrak g_\alpha\oplus\bigoplus_{\alpha\in\Phi^+}\mathfrak g_{-\alpha}.
\end{align*}
Its $B$-dual basis consists of
\begin{align*}
(k_1,\dots,k_r,(f_\alpha)_{\alpha\in\Phi^+},(e_\alpha)_{\alpha\in\Phi^+}).
\end{align*}
Therefore the Casimir element has the expansion
\begin{align*}
\Omega_B=\sum_{i=1}^r h_i k_i+\sum_{\alpha\in\Phi^+}(e_\alpha f_\alpha+f_\alpha e_\alpha).
\end{align*}
[/step]