The Particle Density shader has a Visible in render boolean that can control visibility on a per-particle basis.
So how do you apply this setting on a per-particle basis? One way to access individual particles would be to use an attribute shader to look up a per-particle attribute, and then use that to set the Visible in render value. For example, I used a Color Attribute shader to get the particle color, plugged that into a Color Math Logic, and plugged that into the Visible in render port of the Particle Density shader. In the screenshots below, I’m simply testing whether the particle color is blue.