Q:

How did Goudsmit and Uhlenbeck figure out the electron has spin $\frac{\hbar}{2}$?

Most stuff I read online says that to explain the Anomalous Zeeman Effect they had to assume the electron's gyromagnetic ratio is $\frac{-e}{m}$ instead of the classical $\frac{-e}{2m}$.
But, since what causes the Anomalous Zeeman Effect is not the electron's angular momentum directly, but its magnetic moment, it seems to me like it would've been more reasonable to asssume the electron has the classical gyromagnetic ratio and a spin angular momentum of $\hbar$.
This means they must've had a reason to assume the electron's angular momentum is $\frac{\hbar}{2}$.
Keep in mind this was before Bohr and Heisenberg developed proper Quantum Mechanics.

A:

what causes the Anomalous Zeeman Effect is not the electron's angular momentum directly, but its magnetic moment

On the contrary, both are involved. The value of spin angular momentum enters in determining total angular momentum of a given stationary state, then its degeneracy $2J+1$. Total magnetic moment causes removal of degeneracy in presence of a magnetic field and the amount of splitting is proportional to its magnitude. So electron's magnetic moment contributes to that amount.
If both angular momentum and magnetic moment of electron spin were doubled then all level splittings would be of equal size and the splittings of transition frequencies would be proportional to $\Delta M$, which can only be $0,+1,-1$. So all lines in presence of a magnetic field would split in three: normal Zeeman effect.
On the contrary, with only the spin magnetic moment of double size different unperturbed levels get split by different amounts and the splittings of transition frequencies exhibit different patterns according the pairs of unperturbed levels involved. Also the number of frequencies varies: anomalous Zeeman effect.
I can't expect this quick summary may fully answer your question. I'm afraid the only way to understand the matter is to study it on a QM textbook.
A final historical note. I wouldn't say that Bohr contributed to
creating QM. His rôle was rather in establishing its
epistemological foundations according the so-called Copenhagen
interpretation. I stop here as this topic better pertains to history of physics.

