Given that $\mathrm{tan}\frac{x}{2}=\frac{1-\mathrm{cos}\left(x\right)}{\mathrm{sin}\left(x\right)}$ , deduce that $\mathrm{tan}\frac{\pi}{12}=2-\sqrt{3}$

I know$\mathrm{tan}\frac{x}{2}=\frac{1-\mathrm{cos}\left(x\right)}{\mathrm{sin}\left(x\right)}$ is true and I can prove it by squaring and taking a square root of the right side then I multiply by $\frac{0.5}{0.5}$ . And I will use

$\mathrm{cos}\frac{x}{2}=\sqrt{\frac{1+\mathrm{cos}x}{2}}$

and

$\mathrm{sin}\frac{x}{2}=\sqrt{\frac{1-\mathrm{cos}x}{2}}$

But I do not understand the part of deducing.

I know

and

But I do not understand the part of deducing.