Correction: $$(1+\sqrt 2)^2=3+\color{red}2\sqrt2$$
Generally:
$$(\alpha+\beta\sqrt x)^2=(\alpha^2+x\beta^2)+2\alpha\beta\sqrt x$$
Hence we can recursively solve using simultaneous equations:
$$\begin{cases}\alpha^2+2\beta^2=3 & \\ 2\alpha\beta=2 \end{cases} $$
Using the second to get $\alpha=\frac 1\beta$, we implant this into the first so:$$\frac{1}{\beta^2}+2\beta^2=3\implies2\beta^4-3\beta^2+1=0\implies(2\beta^2-1)(\beta^2-1)=0$$
This yields $$\beta=\pm1, \pm\frac{1}{\sqrt 2}$$
and thusly $$\alpha=\frac1\beta=\pm1,\pm\sqrt 2$$
The first pair gives us $\pm(1+\sqrt 2)$, and the seconnd pair gives $\pm(\sqrt 2+\frac{1}{\sqrt2}\sqrt2)=\pm(1+\sqrt2)$ which is the same result, achieved a different way.