Let $L$ be a finite-dimensional Lie algebra whose adjoint representation is completely reducible.
This means that we have a decomposition
$$
L = L_1 ⊕ \dotsb ⊕ L_n
\tag{$\ast$}
$$
into irreducible subrepresentations $L_j$.
Each $L_j$ is thus an ideal of $L$, and $(\ast)$ is a decomposition of $L$ into ideals.
This implies that the Lie bracket of $L$ is calculated summand-wise with respect to the decomposition $(\ast)$;
i.e., we have
$$
[x_1 + \dotsb + x_n,\; y_1 + \dotsb + y_n]
=
[x_1, y_1] + \dotsb + [x_n, y_n]
$$
for all $x_j, y_j ∈ L_j$.
This has the following consequences.
We have $[L, L] = [L_1, L_1] ⊕ \dotsb ⊕ [L_n, L_n]$.
We have $\mathrm{Z}(L) = \mathrm{Z}(L_1) ⊕ \dotsb ⊕ \mathrm{Z}(L_n)$.
The $L$-subrepresentations of $L_j$ are precisely the $L_j$-subrepresentations of $L_j$.
But $L_j$ is irreducible as an $L$-representations, so it is irreducible as an $L_j$-representation.
This means that $L_j$ is either simple as a Lie algebra, or one-dimensional and abelian.
We may rearrange the summands $L_1, \dotsc, L_n$ in such a way that $L_1, \dotsc, L_m$ are simple and $L_{m + 1}, \dotsc, L_n$ are one-dimensional and abelian.
We find that
\begin{align*}
[L, L]
&=
[L_1, L_1] ⊕ \dotsb ⊕ [L_m, L_m] ⊕ [L_{m+1}, L_{m+1}] ⊕ \dotsb ⊕ [L_n, L_n]
\\
&=
L_1 ⊕ \dotsb ⊕ L_m ⊕ 0 ⊕ \dotsb ⊕ 0
\\
&=
L_1 ⊕ \dotsb ⊕ L_m
\end{align*}
is a sum of simple Lie algebras, and therefore semi-simple.
We also find that
\begin{align*}
\mathrm{Z}(L)
&=
\mathrm{Z}(L_1) ⊕ \dotsb ⊕ \mathrm{Z}(L_m) ⊕ \mathrm{Z}(L_{m+1}) ⊕ \dotsb ⊕ \mathrm{Z}(L_n)
\\
&=
0 ⊕ \dotsb ⊕ 0 ⊕ L_{m+1} ⊕ \dotsb ⊕ L_n
\\
&=
L_{m+1} ⊕ \dotsb ⊕ L_n \,,
\end{align*}
and therefore
$$
L
=
L_1 ⊕ \dotsb ⊕ L_m ⊕ L_{m+1} ⊕ \dotsb ⊕ L_n
=
[L, L] ⊕ \mathrm{Z}(L) \,.
$$