How does the Higgs boson give mass to other elementary particles like electrons? So, the nucleus of an atom can be broken to protons and neutrons, and those can be broken down to quarks.
Electrons however are a different story, they can't be broken down since they are elementary particles but they do have mass.
So the higgs boson itself does not give mass to particles but the interaction between the Higgs field and the Higgs boson does? How does the electron for example interact with the Higgs field?
 A: In field theory, the dynamics of a system is described by a Lagrangian. For instance, for a free scalar field (spin 0) field, the Lagrangian is
$$
{\cal L} = - \frac{1}{2} ( \partial \phi)^2 - \frac{1}{2} m^2 \phi^2 ~. 
$$
Then, the mass of the particle that corresponds to this field is determined as follows. Recall that in field theory a particle is understood as fluctuation of a field. So a field like $\phi$ may have a base value $h$ and a particle is represented as a fluctuation $f$ on top of this base value. So writing $\phi(x) = h + f(x)$ and substituting this in the Lagrangian and expanding to quadratic order, we find
$$
{\cal L} = - \frac{1}{2} ( \partial f)^2 - \frac{1}{2} m^2 f^2 - m^2 f h  - \frac{1}{2} m^2 h^2 
$$
We should think of this Lagrangian as describing the fluctuation $f$. Then, the mass is read off from the quadratic term as being $m$. Note that for this simple case the would-be "mass" of $\phi$ read off from the first form of ${\cal L}$ is the same as the mass of $f$. This is not always true. For instance, consider a scalar field that is self-interacting with an interaction term $\phi^3$ so that the action is
$$
{\cal L} = - \frac{1}{2} ( \partial \phi)^2 - \frac{1}{2} m^2 \phi^2 -g \phi^3  ~. 
$$
Then, writing as before $\phi(x) = h + f(x)$ we find
$$
{\cal L} = - \frac{1}{2} ( \partial f)^2 - \frac{1}{2} [ m^2 + 6 g h ]  \,f^2 + \cdots $$
In this case, we find that the mass of the particle $f$ is modified to $\sqrt{m^2 + 6 g h}$ so it depends on the "base" value of the field $h$ as well as the coupling constant $g$. Now, whether a field can have a base value or not depends on other factors that I will not explain here. 
In this way, we see that adding interactions modifies the mass of the particle if the field happens to have some sort of base value. It is in this way that the Higgs field gives mass to the electron. Let us see this in some more detail. 
We work with a simplified version of the Higgs field described by a real scalar field $\phi$ (as opposed to the real one which is a fundamental of the SU(2)). It interacts with itself and the electron field $\psi$ according to the following Lagrangian
$$
{\cal L} = - \frac{1}{2} ( \partial \phi)^2 + \frac{1}{2} m^2 \phi^2 - \frac{1}{4} \lambda \phi^4 - i {\bar \psi} \gamma^\mu \partial_\mu \psi - g \phi {\bar \psi} \psi ~. 
$$
The last term is known as the Yukawa interaction term. Now, $\psi$ is a fermionic field and is not allowed to have a base value. For the Higgs field, we write $\phi(x) = h + f(x)$ and we find
$$
{\cal L} = - \frac{1}{2} ( \partial f)^2 - \frac{1}{2} [  3 \lambda h^2  
 - m^2 ]  f^2  - i {\bar \psi} \gamma^\mu \partial_\mu \psi  - g  h {\bar \psi} \psi + \cdots  ~. 
$$
Thus, we find that if the Higgs field has a base value $h$, then the Higgs boson (described by $f$) has mass $m_{\text{Higgs}} = \sqrt{ 3 \lambda h^2 - m^2 }$ and the electron (described by $\psi$) has mass $m_{el} = gh$. This process is the Higgs mechanism. If $h=0$, the electron is massless and this was the case a long time ago. At some point, the Higgs field attained a vev (base value) and $h$ became nonzero and the electron was now massive!
A: Eqs. (5) & (6) here show how leptons couple to the Higgs field, giving the former mass. They are terms in the Lagrangian, viz.
$$
\begin{aligned}
\mathcal{L}_{Y} =
&-\lambda_u^{ij}\frac{\phi^0-i\phi^3}{\sqrt{2}}\overline u_L^i  u_R^j
+\lambda_u^{ij}\frac{\phi^1-i\phi^2}{\sqrt{2}}\overline d_L^i  u_R^j\\
&-\lambda_d^{ij}\frac{\phi^0+i\phi^3}{\sqrt{2}}\overline d_L^i  d_R^j
-\lambda_d^{ij}\frac{\phi^1+i\phi^2}{\sqrt{2}}\overline u_L^i  d_R^j\\
&-\lambda_e^{ij}\frac{\phi^0+i\phi^3}{\sqrt{2}}\overline e_L^i  e_R^j
-\lambda_e^{ij}\frac{\phi^1+i\phi^2}{\sqrt{2}}\overline \nu_L^i  e_R^j
+ \textrm{h.c.}
\end{aligned}\tag5
$$
$$
\begin{aligned}
\mathcal{L}_{m} = -m_u^i\overline u_L^i  u_R^i -m_d^i\overline d_L^i  d_R^i -m_e^i\overline e_L^i  e_R^i+ \textrm{h.c.}
\end{aligned}\tag6
$$
Here each term with an $_L$ or $_R$ subscript is a fermion of left or right chirality, while coefficients such as $m_u^i$ are effective masses that follow from the $\lambda$s by setting the Higgs field in (5) to its vacuum expectation value, viz. $\phi^0=\frac{v}{\sqrt{2}},\,\phi^1=\phi^2=\phi^3=0$.
Gauge bosons require a different treatment, viz. Eqs. (1)-(4) in the same source. Fermions can in theory be massive without violating gauge invariance even without a gauge boson. For example, the electron's electromagnetic Dirac Lagrangian $\overline{\psi}\left(i\gamma^\mu\left(\partial_\mu+qA_\mu\right)-m_e\right)\psi$ allows this. (Having said that, whether this works depends on the gauge group.)
By contrast, the photon $A_\mu$ can't just gain a mass term like that, because adding an $m^2A_\mu A^\mu$ term to $\left(\partial_\mu-iqA_\mu\right)\phi^\ast\left(\partial^\mu+iqA^\mu\right)\phi-\frac{1}{4}F_{\mu\nu}F^{\mu\nu}$ would break the gauge invariance. In fact, the photon is massless. The problem is the W and Z bosons are not, and giving them a gauge-preserving effective mass requires terms of the form $q^2|\phi|^2B_\mu B^\mu$. As with leptons, the mass is proportional to the Higgs vacuum amplitude.
