Edit: In response to the comments a proof using Zorn's lemma is also included in this answer.
Notice that if $X$ is either well-ordered or does not have a least element there is nothing more to prove. The two sets are $X$ and $\varnothing$. Suppose that $X$ has a least element $x_{0}$ but $X$ is not well-ordered.
Define $W_{0} = \{ x_{0} \} $. Suppose that $\beta$ is an ordinal and for all ordinals $\alpha < \beta$ the set $W_{\alpha}$ has been defined and is well-ordered. Furthermore if $\alpha_{0} \leq \alpha_{1} < \beta$, then $W_{\alpha_{0}} \subseteq W_{\alpha_{1}}$.
If $\beta$ is a limit ordinal define $W_{\beta} = \cup \{ W_{\alpha} \colon \alpha < \beta \} $.
If $\beta = \alpha + 1$ there are two cases.
Case 1. The set $X \smallsetminus W_{\alpha}$ has a least element, say $x_{\beta}$. In this case define $W_{\beta} = W_{\alpha + 1} \cup \{ x_{\beta} \} $.
Case 2. The set $X \smallsetminus W_{\alpha}$ does not have a least element. In this case stop the construction. Define $A = W_{\alpha}$ and $B = X \smallsetminus W_{\alpha}$.
Since $X$ is a set, eventually you will run out of elements that can be well-ordered as in case 1. This puts you in case 2.
Proof using Zorn's lemma.
As above suppose that $X$ has a least element but $X$ is not well ordered. Define
$$\mathcal{B} = \{ B \subseteq X \colon B \text{ does not have a least element} \text{.} \} $$
Since $X$ is not well-ordered, the set $\mathcal{B}$ is not empty.
Suppose that $\mathcal{T} \subset \mathcal{B}$ is nonempty and totally ordered by inclusion. Select $t \in \cup \mathcal{T}$.
For some $T \in \mathcal{T}$ we have $t \in T$. Since $T \in \mathcal{B}$, there is a $t^{*} \in T$ which satisfies $t^{*} < t$. But then $t$ is not the least element in $T$, which in turn means $t$ is not the least element in $\cup \mathcal{T}$.
Thus $\cup \mathcal{T} \in \mathcal{B}$. Using Zorn's lemma, there is a maximal $B^{*} \in \mathcal{B}$.
Suppose that $X \smallsetminus B^{*}$ is not totally ordered.
Then there exist $y_{0}, y_{1} \in X \smallsetminus B^{*}$ such that $y_{0} \not \leq y_{1}$ and $y_{1} \not \leq y_{0}$.
Notice that $B^{*} \cup \{ y_{0}, y_{1} \}$ does not have a least element. This contradicts the maximality of $B^{*}$.
Suppose that $X \smallsetminus B^{*}$ is not well-ordered. Then there exists a nonempty $E \subseteq X \smallsetminus B^{*}$ which does not have a least element. Notice that $B^{*} \cup E$ does not have a least element. This contradicts the maximality of $B^{*}$.
Thus $X \smallsetminus B^{*}$ and $B^{*}$ are the desired sets.