I will prove the first implication and leave the other to you.
Assume $\vert A\vert\leq \vert B\vert$.
If $A=\emptyset$, there is nothing to prove, so we can assume $A\ne\emptyset$. Since $\vert A\vert\leq \vert B\vert$ there is an injective map $f:A\to B$. We prove that this has a left-inverse, i.e. there is a $g:B\to A$ such that $g\circ f=\operatorname{id}_A$. Pick $a_0\in A$ arbitrary (possible since $A\ne\emptyset$). Then we define $g:B\to A$ as follows:
\begin{align*}
g(b)=\begin{cases} a ~~~\text{if }a\in A,f(a)=b\\a_0~~~\text{otherwise, i.e. if }b\notin f(A)\end{cases}
\end{align*}
Note that this is well-defined since $f$ is injective, i.e. if there is som $a\in A$ with $f(a)=b$ then this $a$ is uniquely determined. Similarly we can check that $g\circ f = \operatorname{id}_A$. Now we claim that this $g$ has to be surjective. Let $a\in A$. Then $g(f(a))=\operatorname{id}_A(a)=a$ hence $f(a)$ is a preimage of $a$ for $g$, so $g$ is surjective. So we proved that there is a surjective map $B\to A$, hence $\vert B\vert\geq\vert A\vert$.
Now do something similar for the other direction, i.e. $\vert B\vert\geq\vert A\vert\implies \vert A\vert\leq\vert B\vert$.
(Here I assumed that the definition of $\vert B\vert\geq\vert A\vert$ is that there is a surjective map $B\to A$ and for $\vert A\vert\leq\vert B\vert$ that there is an injective map $A\to B$)