The Higgs mechanism generates masses for gauge bosons through spontaneous breaking of a gauge symmetry. The would-be Goldstone bosons are "eaten" by the gauge bosons, becoming their longitudinal polarization components. The gauge bosons acquire mass while the theory remains renormalizable. The physical Higgs boson is the remaining massive scalar excitation.
The Higgs mechanism is the process by which gauge bosons acquire mass through spontaneous symmetry breaking, without destroying gauge invariance or renormalizability. The simplest example is the abelian Higgs model: a U(1) gauge field A_mu coupled to a complex scalar phi with a Mexican hat potential. The Lagrangian is L = -1/4 F^2 + |D_mu phi|^2 - V(phi), where D_mu = partial_mu - ieA_mu is the covariant derivative and V = -mu^2|phi|^2 + lambda|phi|^4.
When phi acquires a vacuum expectation value <phi> = v/sqrt(2), the covariant derivative term |D_mu phi|^2 evaluated at the vacuum generates e^2 v^2 A_mu A^mu / 2 -- a mass term for the gauge field with m_A = ev. The angular degree of freedom of phi (the would-be Goldstone boson) is absent from the physical spectrum in unitary gauge; it has been absorbed into the gauge field as its longitudinal polarization. The radial fluctuation remains as a massive scalar particle -- the Higgs boson with mass m_H = sqrt(2 lambda) v.
In the Standard Model, the electroweak gauge symmetry SU(2)_L x U(1)_Y is broken to U(1)_EM by a complex scalar doublet (four real components). Three Goldstone bosons are eaten by the W+, W-, and Z bosons, giving them masses. The fourth component remains as the physical Higgs boson, discovered at the LHC in 2012 with mass 125 GeV. The vacuum expectation value v = 246 GeV is fixed by the measured Fermi constant. The W and Z masses are then predictions: m_W = gv/2 approximately 80 GeV and m_Z approximately 91 GeV, in excellent agreement with experiment.
Fermion masses are also generated through the Higgs mechanism. Direct mass terms m psi-bar psi are forbidden by the chiral structure of the electroweak interaction (left- and right-handed fermions transform differently under SU(2)). Instead, Yukawa couplings y psi-bar_L phi psi_R connect the fermion fields to the Higgs doublet. When phi gets its vacuum expectation value, these become mass terms m_f = y_f v/sqrt(2). Each fermion's mass is proportional to its Yukawa coupling, which is a free parameter. The proof by 't Hooft and Veltman that theories with the Higgs mechanism are renormalizable was the theoretical foundation for the Standard Model.