We have, $|z|-z=1+2 i$
If $z=x +i y$, then this equation reduces to
$|x +i y|-(x +i y)=1+2 i$
$\Rightarrow \left(\sqrt{x^{2}+y^{2}}-x\right)+(-i y)=1+2 i$
On comparing real and imaginary parts of both sides of this equation, we get $\sqrt{x^{2}+y^{2}}-x=1$
$\Rightarrow \sqrt{x^{2}+y^{2}}=1+x$
$\Rightarrow x^{2}+y^{2}=(1+x)^{2}$
$\Rightarrow x^{2}+y^{2}=1+x^{2}+2 x$
$\Rightarrow y^{2}=1+2 x$ ...(i)
and $-y=2$
$\Rightarrow y=-2$
Putting this value in Eq. (i), we get
$(-2)^{2}=1+2 x$
$\Rightarrow 2 x=3$
$\Rightarrow x =\frac{3}{2}$
Hence, $z =x +i y$
$=\frac{3}{2}-2 i $