Quarks, which are elementary particles that make up protons, neutrons, and other particles, interact with each other through the strong nuclear force. The strong force is mediated by particles called gluons, which are the carriers of the force between quarks.
Quarks carry a property called color charge, which is analogous to electric charge in electromagnetism. However, unlike electric charge, which can be positive or negative, color charge comes in three types: red, green, and blue (these names are simply labels and not related to actual colors). Antiquarks carry anti-color charge: anti-red, anti-green, and anti-blue.
Gluons carry a combination of color and anti-color charge. So, for example, a gluon may carry one unit of red color charge and one unit of anti-red color charge. The gluons can interact with quarks by changing their color charge.
Quarks and gluons interact through a process called gluon exchange. The exchange of gluons allows quarks to change their color charge by absorbing or emitting a gluon. This interaction maintains the confinement of quarks within hadrons (particles composed of quarks), preventing them from existing in isolation. The strong force between quarks mediated by gluons is what holds protons and neutrons together in the atomic nucleus.
It's important to note that the strong force and the exchange of gluons are described within the framework of a theory called quantum chromodynamics (QCD). QCD is the quantum field theory that describes the behavior of quarks and gluons and their interactions through the strong nuclear force.