What's also important to note is that due to the mexican-hat shape of the Higgs-field potential, the vacuum expectation value of the Higgs field is non-vanishing. If the symmetry were a global symmetry that would mean that there's spontaneous symmetry breaking, i.e., the ground state ("vacuum") were degenerate and there would necessarily be massless scalar bosons in the physical particle spectrum (the Nambu-Goldstone modes of some scalar or pseudoscalar fields), but that's NOT the case here, where the symmetry is a local gauge symmetry.
What rather happens here is that the field-degrees of freedom which would be the Nambu-Goldstone modes for a global symmetry now provide the necessary additional spatially longitudinal polarization states of the corresponding gauge bosons which get massive via their couling to the Higgs field. That must be so, because massless gauge bosons as spin-1 vector bosons have only 2 polarization degrees of freedom (like photons, where you usually choose the momentum-helicity single-particle basis to build up the Fock space, and the helicity can only take 2 values, ##\pm 1##, corresponding to left- and right-circular polarized photons) but massive spin-1 vector bosons have 3 spin-degrees of freedom. The additional spin-degree of freedom for each gauge boson that becomes massive through the Higgs mechanis thus is provided by the would-be Goldstone modes of the Higgs field.
In the usual minimal realization of the Higgs sector in the standard model you start with a weak-isospin doublet for the Higgs field, i.e., 4 real field-degrees of freedom. When Higgsing, i.e., choosing a gauge invariant Mexican-hat potential, where thus the vacuum expectation value of the Higgs doublet is non-vanishing, 3 of the 4 real field-degrees of freedom are the would-be-Goldstone modes and thus are "absorbed" into the corresponding gauge bosons that become massive.
In the case of the electroweak standard model the gauge group is ##\mathrm{SU}(2)_{\text{L}} \otimes \mathrm{U}(1)_{\text{Y}}##, and this group is Higgsed to the remaining ##\mathrm{U}(1)_{\text{em}}##. This means that out of 4 group dimensions 3 become Higgsed and thus of the corresponding 4 gauge bosons 3 get massive (these are the electrically charged ##W^{\pm}## and the electrically neutral ##Z^0## bosons mediating the weak interaction) and one stays massless (which is the electromagnetic field, i.e., the photon field, mediating the electromagnetic interaction).
Now another specialty of the electroweak standard model is that the gauge group is chiral. Thus the matter fields (leptons and quarks) cannot be simply taken massive, because this would explicitly violate the gauge symmetry, and in the case of a local gauge symmetry that would make the entire edifice obsolete! Thus you have to provide masses to the matter particles also via the Higgs mechanism, i.e., you couple the Higgs doublet gauge-invariantly to the matter fields. Staying with renormalizable interactions this leads to Yukawa couplings between the Higgs-boson field and the fermion fields for leptons and quarks. Then there's also another complication that in the quark sector the weak isospin eigenstates are not the mass eigenstates, i.e., you also need a socalled mixing matrix transforming between the mass and isospin eigenbasis of the quark fields (Cabibbo-Kobayashi Maskawa or short CKM matrix). This gives mass to the charged leptons (electrons, muons, tau leptons) and leaves the neutral ones (the corresponding neutrinos) massless.
Another danger with chiral gauge symmetries (and the electroweak standard model must be chiral in order to provide the observed breaking of parity symmetry by the weak interaction, realized as the "vector-minus-axialvector" maximal breaking pattern) is that there might be anomalies, i.e., chiral gauge symmetries which are valid for the classical field theory may become violated by quantization. Sometimes that's wanted for global gauge symmetries. E.g., in the standard model in the chiral limit there's a symmetry under ##\mathrm{U}(1)_{\text{A}}## transformations, but that symmetry is not realized in nature, and indeed it's found to be anomalously broken, and this is very welcome in the electromagnetic interaction of the pions since only with the anomaly you get the right decay rate for ##\pi^0 \rightarrow \gamma \gamma##.
For a local gauge symmetry an anomaly, however is letal, since this means that this local gauge symmetry were explicitly broken by quantizaing the theory and then would become obsolete. Fortunately in the case of the standard model, taking all the leptons and quarks (the latter with the specific charge pattern of -1/3 and 2/3 quarks in each family and their additional color degrees of freedom with the color Group being ##\mathrm{SU}(3)## of QCD leads to a perfect cancellation of the possible anomaly of the ##\mathrm{SU}(2)_{\text{L}}## chiral gauage symmetry, and thus the ew. standard model is consistent.