If $\mathfrak{h}$ is a maximal ideal, then there exists a subalgebra $\mathfrak{l}$, such that $\mathfrak{g} = \mathfrak{h}\oplus\mathfrak{l}$ 
Definition: 
  Let $\mathfrak{g}$ be a Lie algebra, a ideal $\mathfrak h \subset \mathfrak g$ is called a maximal ideal, if for all ideal $\mathfrak{h}_1 \subset \mathfrak{g}$  such that $\mathfrak{h}\subset \mathfrak{h}_1$, then $\mathfrak{h}_1 = \mathfrak{h}$ or $\mathfrak{h}_1 = \mathfrak{g}$.

I'm trying to solve the following exercise

Question: Let $\mathfrak g$ be a Lie algebra and $\mathfrak{h}\subset \mathfrak{g}$ a maximal ideal, then there exists a subalgebra $\mathfrak{l}$ such that $\mathfrak{g}=\mathfrak{h}\oplus\mathfrak{l}$.

Can anyone help me?

Some ideas
Consider the projection 
$$\pi:\mathfrak{g}\to\mathfrak{g}/\mathfrak{h}, $$
once $\mathfrak{h}$ is a maximal ideal, then $\mathfrak{g}/\mathfrak{h}$ is simple. If $\mathfrak{i}\subset \mathfrak{g}/\mathfrak{h}$ is a ideal of $\mathfrak{g}/\mathfrak{h}$, then $\pi^{-1}(\mathfrak{i})$ is a ideal of $\mathfrak{g}$ satisfying $\mathfrak{h}\subset \pi^{-1}(\mathfrak{i})$, using the maximality of $\mathfrak{h}$, $\mathfrak{i}=\{0\}$ or $\mathfrak{i}=\mathfrak{g}/ \mathfrak{h}$. How shoud I proceed? I tryied to use Levi decomposition but I did not get many results.
N.B: $\oplus$ denotes the direct sum of vector space, $\mathfrak{g}$ is a finite dimensional Lie algebra.
 A: Maybe I've figured out how to do the question. Consider 
$$\pi: \mathfrak{g}\to \mathfrak{g}/\mathfrak{h}, $$
the usual projection.
By the Levi decomposition theorem $\mathfrak g = \mathfrak s\oplus \mathfrak r(\mathfrak g)$, where $\mathfrak r(\mathfrak g)$ is the solvable ideal of $\mathfrak{g}$ and $\mathfrak s$ is a semisimple subalgebra. Since $\mathfrak g / \mathfrak h$ is simple and $\pi(\mathfrak r(\mathfrak g))$ is solvable, then $ r(\mathfrak g) \subset \mathfrak h$. Moreover $\pi(\mathfrak{s})$ is surjective, implying 
$$\frac{\mathfrak s}{\mathfrak s \cap \mathfrak h} \cong \mathfrak{g}/\mathfrak{h}.$$ 
Once $\mathfrak{s}$ is semisimple there exist simple ideals $\mathfrak{i}_0,\mathfrak{i}_1,...,\mathfrak{i}_n$, such that
$$\mathfrak{s} =\mathfrak{i}_0\oplus \mathfrak{i}_1\oplus \dots\oplus\mathfrak{i}_n,  $$
since  $\mathfrak{g}/\mathfrak{h}$ is simple, we can suppose without loss of generality 
$$\mathfrak{s}\cap \mathfrak{h} =  \mathfrak{i}_1\oplus\cdots\oplus\mathfrak{i}_n,$$
because every ideal of $\mathfrak{s}$ has the form $\mathfrak{i}_{k_1}\oplus \dots \oplus \mathfrak{i}_{k_m}$.
Then 
\begin{align}
\mathfrak{g} &= \mathfrak{s}\oplus \mathfrak r(\mathfrak g)\\
& = (\mathfrak{i}_0\oplus \mathfrak{i}_1\oplus \dots\oplus\mathfrak{i}_n)\oplus r(\mathfrak g)\\
&= \mathfrak{i}_0\oplus( \mathfrak{i}_1\oplus \dots\oplus\mathfrak{i}_n\oplus r(\mathfrak g)),
\end{align}
once $\pi( \mathfrak{i}_1\oplus \dots\oplus\mathfrak{i}_n\oplus r(\mathfrak g)) = \{0\}$, we conclude
$$\mathfrak{i}_1\oplus \dots\oplus\mathfrak{i}_n\oplus r(\mathfrak g))\subset \mathfrak{h},$$
finally, comparing dimensions $\mathfrak{i}_1\oplus \dots\oplus\mathfrak{i}_n\oplus r(\mathfrak g)= \mathfrak h$.
Implying
$$\mathfrak g = \mathfrak i_0 \oplus \mathfrak h, $$
and finishing the demonstration.
