This statement (usually known as Hartogs' Trichotomy Theorem) is equivalent to the axiom of choice in ZF.
If you want to prove it from Zorn's lemma, check for my answer to this question, in which I demonstrate that Zorn's lemma implies Zermelo's well-ordering theorem.
If you want to prove it directly, using the original statement of the axiom of choice, we first need to prove the following
Theorem: The axiom of choice implies Zermelo's well-ordering theorem
Demonstration: Let $A$ be a set, and let $f$ be a choice function for $\mathcal{P}(A)$, that is, $f$ is a function whose domain includes the set $\mathcal{P}(A)\setminus\{\varnothing\}$
, and is such that for each $B\subseteq A$, if $B\not=\varnothing$, then $f(B)\in B$.
Let $z$ be a set that does not belong to $A$ (that exists as a consequence, for example, of Cantor's theorem).
By transfinite induction over the ordinals we define the following On-sequence $(a_\alpha)_{\alpha\in\text{On}}$: for each ordinal $\alpha$:
$$a_\alpha=\begin{cases}
\displaystyle f(A\setminus\{a_\beta|\;\beta<\alpha\})\qquad\text{if }A\setminus\{a_\beta|\beta<\alpha\}\text{ is not empty} \\
\displaystyle z\qquad\qquad\qquad\qquad\quad\,\,\,\text{if }A\setminus\{a_\beta|\;\beta<\alpha\}=\varnothing
\end{cases}$$
Let $\alpha$ be an ordinal such that $A\setminus\{a_\beta|\;\beta<\alpha\}$ is not empty, and let $\beta_1,\beta_2<\alpha$ such that $\beta_1<\beta_2$. Then $a_{\beta_1}$ and $a_{\beta_2}$ are elements of $A$, and are different from each other, because $a_{\beta_2}=f(A\setminus\{a_\beta|\;\beta<\beta_2\})$, which is a element of $A\setminus\{a_\beta|\;\beta<\beta_2\}$, and $a_{\beta_1}$ does not belong to this set. Therefore, for each ordinal $\alpha$ such that $A\setminus\{a_\beta|\;\beta<\alpha\}\not=\varnothing$, the $\alpha$-sequence $\langle a_\beta|\;\beta<\alpha\rangle$ is an injective application from $\alpha$ to $A$.
But this cannot occur for every ordinal $\alpha$: suppose on the contrary that this is true for every ordinal $\alpha$. Then the On-sequence $(a_\alpha)_{\alpha\in\text{On}}$ is an injective class-function from the proper class On in the set $A$. By the axiom-schema of subsets, the image $\{a_\alpha|\;\alpha\in\text{On}\}$ is a set $-$ which we shall denote by $B$ $-$ because it is included in the set $A$. And, since $(a_\alpha)_{\alpha\in\text{On}}$ is injective (since $\beta<\alpha$ implies $a_\beta\not=a_\alpha$), the inverse class-relation $((a_\alpha)_{\alpha\in\text{On}})^{-1}:B\twoheadrightarrow\text{On}$ is a class-function from the set $B$ onto the propper class On. This contradicts the axiom-schema of replacement, which ensures that the image of a set via a class-function is always a set, and it cannot be a proper class like On.
Therefore, there are ordinals $\alpha$ for which $A\setminus\{a_\beta|\;\beta<\alpha\}=\varnothing$. Let $\alpha_0$ be the least ordinal such that $A\setminus\{a_\beta|\;\beta<\alpha_0\}=\varnothing$. Then we have
$$A=\{a_\beta|\;\beta<\alpha_0\}$$
And $\langle a_\beta|\beta<\alpha_0\rangle$ is an injective function from $\alpha_0$ onto $A$, that is, it is a bijective function from $\alpha_0$ onto $A$. But $\alpha_0$ has a natural well-order, $\in_{\alpha_0}$, and this well-order of $\alpha_0$ is transferred by the bijective function $\langle a_\beta|\;\beta<\alpha_0\rangle$ to a well- order of $A$, that is, the relation $<_R$ defined by:
$$\text{For all }\,\beta,\,\gamma<\alpha_0,\qquad a_\beta<a_\gamma\Leftrightarrow\beta<\gamma$$
And therefore, $A$ has a well-order; namely, $<_R$.
After proving that Zorn's lemma $-$ or the axiom of choice $-$ implies Zermelo's well-ordering theorem, then we finally can prove
Hartogs' trichotomy theorem: For any sets $A$ and $B$, $A\preccurlyeq B$ or $B\preccurlyeq A$
Demonstration: from Zermelo's well-ordering theorem, if $A$ and $B$ are sets, let $<_R$ and $\prec_S$ be well-orderings of $A$ and $B$ respectively. Then there exist unique ordinals $\alpha$ and $\beta$ such that $\langle A,<_R\rangle\cong\langle\alpha,\in_\alpha\rangle$ and $\langle B,\prec_S\rangle\cong\langle\beta,\in_\beta\rangle$. And then, since $A\approx\alpha$ and $B\approx\beta$, we then have that if $\alpha\leq\beta$, $A\preccurlyeq B$, and if $\beta\leq\alpha$, then $B\preccurlyeq A$
On the other hand, if you ever want to prove the other implication, that Hartogs' trichotomy theorem implies the axiom of choice, you may want to follow this argument:
Theorem: Hartogs' trichotomy theorem implies Zermelo's well-ordering theorem
Demonstration Let $A$ be a set. By Hartogs' theorem (c.f. page 50, theorem 4.33), there exists an ordinal $\alpha$ that is not shrinkable in $A$. By Hartogs' trichotomy principle, if $\alpha\not\preccurlyeq A$, then $A\preccurlyeq\alpha$, and $A$ is shrinkable in $\alpha$, therefore $A$ has a well-ordering, the one that is transferred from the well-order $\in_\alpha$ os $\alpha$ via an injective function from $A$ to $\alpha$.
Theorem: Zermelo's well-ordering principle implies the axiom of choice
Demonstration: Let $A$ be a set. By Zermelo's well-ordering theorem, there exists a relation $<_R\subseteq\,\big(\bigcup A\big)\times\big(\bigcup A\big)$ that well orders $\bigcup A$. Then the function $f$ of domain $A\setminus\{\varnothing\}$ defined by: for each $a\in A\setminus\{\varnothing\}$
$$f(a)=\text{the minimal element of }a\text{ in the sense of }<_R$$
Is a choice function for $A$, if $\varnothing\not\in A$. If $\varnothing\in A$, simply take $f\cup\{\langle \varnothing ,\varnothing\rangle\}$
Combining the last two results, we can easily conclude that the Hartogs' trichotomy theorem implies the axiom of choice