If the Higgs field gives particles mass, and is present everywhere, then why are there massless particles? According to this article:

Imagine that all of space is uniformly filled with an invisible substance—now called the Higgs field—that exerts a drag force on particles when they accelerate through it. Push on a fundamental particle in an effort to increase its speed and, according to Higgs, you would feel this drag force as a resistance. Justifiably, you would interpret the resistance as the particle’s mass. For a mental toehold, think of a ping-pong ball submerged in water. When you push on the ping-pong ball, it will feel much more massive than it does outside of water. Its interaction with the watery environment has the effect of endowing it with mass. So with particles submerged in the Higgs field.

So if the Higgs field is present in all space, why are there massless particles? Does that mean that they do not interact or go through the Higgs field?
 A: The usual pop-sci explanation of "the Higgs field exerting a drag force on particles that move through it, sapping their kinetic energy" is unfortunately not very accurate. In technical terms, the mass generation for the weak gauge bosons is really due to the spontaneous symmetry breaking in the Higgs mechanism, and the associated Yukawa couplings generate mass terms for the fermions of the Standard Model (except neutrinos). There is additionally an important distinction to be made between the "Higgs boson" and the "Higgs field", though these are often conflated and even fused in pop-sci descriptions.
I will attempt to explain this in a manner that is more accurate than the pop-sci description while still being accessible. The punchline is:
Although the massive particles continuously interact with the Higgs boson which is present throughout space, this does not give them mass. The Higgs mechanism gives them mass once and for all at the electroweak transition scale.
"Spontaneous symmetry breaking at the electroweak transition scale" roughly means this: at very high energies, the picture of particle physics and phenomenology is very different from ordinary energies. "Very high energies" is entirely equivalent to "very small distances", and we call the energy at which we are looking at the theory the "energy scale".
If, starting from very high energies, you begin to decrease the energy scale, when you reach the electroweak scale at 160 GeV, the Higgs field "condenses". An almost perfect analogy for this phenomenon is how, starting at say 20 °C, you can decrease the temperature of water until it suddenly freezes into ice at 0 °C. Now 160 GeV roughly corresponds to a temperature of $1.85\times 10^{15}\ \mathrm K$, which is really, really high, but still within the domain of the Large Hadron Collider. At this point, and this point alone, the gauge fields and fermion fields gain a mass term, and hence their quanta - the gauge bosons and fundamental fermions - are no longer massless and become massive.
At energies below this scale, they do not have to interact with anything (no pop-sci-esque "Higgs boson fluid") to keep this mass. Indeed, massless and massive particles are fundamentally different in quantum field theory, so a "continuous" interaction type of approach to give mass to particles is doomed right from the get go.
To make sure that e.g. photons do not gain a mass in this process, we encode the exact way that the symmetry breaking takes place into the model.
This choice of symmetry breaking is not arbitrary, nor is it predicted by theory. The whole idea of electroweak spontaneous symmetry breaking is to explain the masses of the $W^\pm$ and $Z$ gauge bosons (and fermions), all with the underlying assumption that the photon is massless, and this is what we put into our model by hand. We could very well have built a similar model where the photon is massive - but we don't, because we don't observe such a thing. Everything need not interact with everything else - the electromagnetic field too permeates throughout spacetime, but does not interact with uncharged particles.
So the real reason that the photon does not gain a mass by the Higgs mechanism is because we don't want it to, otherwise our model would be inaccurate.
Nevertheless, if you are interested in probing deeper, here are
The specifics (but not too technical)
For now, focus only on the nature of the $W^\pm$, $Z$ and $\gamma$ (photon). Ignore the gluons, since they play a mere spectator role in the mass generation - they are unaffected (we say that "the $\mathrm{SU}(3)$ color group remains unbroken"). This is due to the nature of our model building - we should be able to declare that certain particles are massless, and dictate which particles should interact with each other, provided that the resulting model is consistent with the theoretical framework.
Unfortunately, the simplest model that we can build to accommodate the massive nature of the weak force bosons and fermions fails immediately for a straightforward reason: the existence of a mass term violates the gauge symmetry of the fundamental forces, and so our theory is mathematically inconsistent. The Higgs mechanism is the simplest (and only viable) method to explain this, but curiously the photon is not merely a spectator like the gluons and is present in the mechanism.
Prior to spontaneous symmetry breaking, i.e. at energies higher than the electroweak scale, there are four massless gauge fields living peacefully - call them the $W^1, W^2, W^3$ and $B$. In other words, there are four electromagnetic-like forces above 160 GeV, and associated to each one is its own "charge" determining the strength and nature of interactions, exactly the way the photon/electromagnetic field at ordinary energies couples to the electric charge. These gauge fields coexist with the Higgs field - which, most importantly, has a non-zero charge under all of these fields.
At the electroweak transition scale, the Higgs field undergoes spontaneous symmetry breaking. We say that the $\mathrm{SU}(2)_L\times \mathrm U(1)_Y$ symmetry is broken down to $\mathrm U(1)_\mathrm{EM}$. What this means, roughly, is that the original four degrees of freedom (DOF) of the Higgs field break up into a vacuum expectation value with 0 DOF, a Higgs boson with 1 DOF and 3 "Goldstone bosons" with 1 DOF each. This is roughly like how water loses its freedom to flow in different directions after the phase transition, with the DOF "freezing out".
So why don't we observe these Goldstone bosons as physical particles at regular energy scales? Well, owing to the nature of the symmetry breaking, three linear combinations of the four originally massless gauge fields "eat" one Goldstone boson each and become massive, forming the $W^+, W^-$ and $Z$ bosons. The final linear combination remains massless - there are no more Goldstone bosons left - and forms the photon. The upshot is that after spontaneous symmetry breaking, there are now 3 massive gauge bosons, 1 massless one (that is distinct from each of the above massless gauge fields) and a Higgs boson, a "remnant" of the symmetry breaking.
To stress again, this mass generation occurs at exactly one point - the electroweak transition scale. It is not a process of a massless particle having to continuously "bombard" against the Higgs boson to gain mass or anything of that sort.
So if this "mass generation" supposedly happens at a single scale, why can processes like pair production take place at any energy? It's because these are two completely distinct phenomena. In the Higgs mechanism, we are fundamentally altering the particle content of the theory. Above the electroweak scale, there simply aren't any massive fundamental particles, and below it, there are. Pair production of mass on the other hand is simply a consequence of the mass-energy equivalence of special relativity. If there did exist massive particles above the electroweak scale, then pair production would also be possible there - they are unrelated processes.
"Mass generation happens at a single scale" should not be interpreted as "all mass is created forever, and no mechanisms like pair creation and annihilation can change this". It means that the quanta of the post-SSB fundamental fields now have a mass, whereas the quanta of the pre-SSB fields did not. These are very distinct statements.
It is seen that while only the massive fields end up interacting with the residual Higgs boson post-SSB, these interactions don't play any role in generating masses. The existence of the Higgs boson does however serve as an important verification of the Higgs mechanism.
There are of course no a priori reasons that photons and gluons should be massless gauge bosons (at ordinary energies) - these are experimentally validated through the nature of the forces that they produce. That is, the massless nature of photons makes accurate predictions of the resulting Coulomb-like electromagnetic force that we observe in nature. Indeed, there is no 100% experimental confirmation of the masslessness of the photon - we can only impose tighter and tighter upper mass bounds, as mentioned here. The massless model for gluons makes similarly accurate predictions, though the subtlety of non-abelian gauge theories means that the mediated force does not manifest as a Coulomb-like force.
A: The reason why photons and gluons are massless is because the Higgs field does not carry the type of charge responsible for their corresponding interactions.

*

*gluons mediate the strong interaction

*photons mediate the electromagnetic interaction

The Higgs field is not color charged, nor electrically charged.
The reason why some matter particles are massless has to do with the way this interaction (matter particle - Higgs field) works. Without getting into technicalities, the matter particle - Higgs field interaction can lead to a (non-zero) mass term only if the matter particle has both left-handed and right-handed components. Neutrinos, for example, are only left-handed, the right-handed neutrinos have not been experimentally observed (yet), thus we believe that they get their mass through another mechanism (other than the Higgs mechanism).
A: The Higgs field, boson, and mechanism, do not act as resistance. That article is horribly wrong.  Its like saying, a prism splits white light into colours because when you make glass in a  prism shape it resists some colours more than others. It doesn't.
As I've commented, Wikipedia has a really good explanation. Try that first.
In particle physics, as we currently understand it,particles don't have mass automatically. They have to get it from somewhere, from some interaction or other. Without that,they would be massless. We see that some particles do acquire mass (or have acquired it), and some don't. So a big question in the 1950s and 1960s was, "Why do they? What decides which particles gain mass and which dont? How does it happen?"
The short version is, that the Higgs field exists throughout space. It's responsible for mass acquisition happening to many particles.  (Some particles gain mass through other interactions so it's not the only way this can happen).  Its a very unusual field, we don't know of another like it, yet.  It interacts with the other quantum fields that are responsible for most of the forces and particles we see around us, and changes some of them, in quite significant ways. One way it can interact with and change other fields and their particles is called the Higgs mechanism, and it's the Higgs mechanism that results in mass.  One of the ways we can detect a Higgs field and prove it's out there is its "excitations", a particle known as the Higgs boson.
Let's take a step back, to see how it works.
If you think about say, the electromagnetic field, some particles (charged particles) respond and interact with it. Some don't (uncharged particles). But how do we know whats a charged or uncharged particle?  Only because we watch if they interact with an electromagnetic field in the first place.  No other way to tell! That's what tells us what's charged and what isn't.
So, if you fire an electron and a neutron past a magnet, the electron will change its direction/behaviour because it interacts with the magnet's electromagnetic field. The neutron will carry on without even noticing an magnet is there. The electromagnetic field didn't "resist" the electron. It just happens to interact with that particle and changes how it acts, and doesn't interact with the neutron. And that's how charge and the electromagnetic field creates a force.
When you put metal near a magnet, some metal becomes magnetised. Some doesn't. For example an iron bar near a magnet, will start to attract iron filings. A copper bar near a magnet, won't. So a field can also change how other things interact with other objects, not just how they move.
If you were an iron filing you might think the magnetic field has "changed" the metal bar from "ignoring iron filings" to "pulling on them", for some metals but not all metals. That's a bit like how particles "see" the Higgs field - it changes some particles from massless to having mass (if the Higgs mechanism is part of that interaction and has that effect), and doesn't change other particles.
The Higgs field gives mass to some particles, somewhat like this analogy.

*

*Some particles interact with the Higgs field. Like the electron in an electromagnetic field, they change behaviour because of that interaction. One change that some particles can experience is, they gain a property called mass (or gain more mass), which then shapes spacetime, and responds to some interactions - we call this property they've gained, "mass", and there are formulae that express how particles and objects with mass, behave.

*Some particles don't interact with the Higgs field at all (or interact without the Higgs mechanism occurring). So they aren't affected at all by it. They don't gain mass from it. So like the neutron in an electromagnetic field, they behave like they were behaving anyway - if they got mass from something else, or if they don't have any mass.

But the Higgs field is everywhere. So throughout the universe as far as we can tell, certain particles have mass. Others don't. Quantum field theory, called the Standard Model, helps us to figure out which particles will interact and which won't. For example:

*

*W and Z bosons - yes, interact with Higgs field and their behaviour and properties are changed as a result (via the Higgs mechanism, directly). Gets mass.

*Quarks and some kinds of leptons - yes, interact with Higgs field and their behaviours and properties are changed as a result (via a different kind of interaction called Yukawa coupling, that is made possible by the Higgs mechanism). Gets mass.

*Photon and some or all massless particles (not quite sure which) - no, doesn't interact with Higgs field in a way that causes the Higgs mechanism to give them mass. Stays massless as it was "before" (or as if there wasn't a Higgs field).

*Some composite particles such as protons and neutrons - these do interact with the Higgs field and get some of their mass that way, but something like 99% of their mass is acquired in other ways - from the energy of the quarks, gluons and strong interactions that bind them together.

And that's in brief, how it actually works.
(Ignoring some advanced points covered in the article I linked, like tachyonic fields/symmetry breaking, and Yukawa couplings and so on, which aren't needed for a basic understanding. Also apologies for sloppy wordings and shortcuts and resulting inaccuracies, I am aware this is not technically precise. But it is at least comprehensible by a lay person!)
Technical update
Technically, in the Standard Model, mass requires that the formulae for a quantum field (or particle's) behaviour include matching left and right hand terms. Then the particles with such terms, will have the property we call "mass". We call these, "mass terms", because a particle with such terms in its formula, will exhibit the property we call "mass". The expression "chiral" or "chirality" you might see used, refers to this "left or right handedness".
Initially and in isolation, no quantum fields and none of their related particles have formulae with such terms, so we expect that no particles start with any mass. But if a quantum field interacts with a different field, these formulae may change and possibly then, particles that exist due to that field could end up with such mass terms in its modified formula, even if they weren't there originally. That's how it's possible that in some cases a particle doesn't have mass, and then, after interacting with the Higgs field, they gain mass. But it's believed that change only happens below some extreme temperature (about 1015 K, or about 160 GeV), so the affected particles suddenly altered from massless, to having a mass, once the Universe cooled down to that, after the Big Bang. That's also why the Higgs field is so unusual (or was when it was first suggested), and so important to understand, because it can have that precise effect.
