When I scratch my head I get white dandruff with little black bits in it what are they?

Dandruff. Dandruff is a common scalp condition in which small pieces of dry skin flake off of the scalp. If you have dark hair or you’re wearing dark colors, you may notice the flakes in your hair or on your shoulders. Dandruff may also make your scalp itch. https://www.aad.org/public/skin-hair-nails/hair-care/how-to-treat-dandruff.
Debris. The black bits likely represent altered skin cells and may be mild seepage of red blood cells. This is not a cause for concern. You may wish to shampoo your scalp more often. For good health - Have a diet rich in fresh vegetables, fruits, whole grains, milk and milk products, nuts, beans, legumes, lentils and small amounts of lean meats. Avoid saturated fats. Exercise at least 150 minutes/week and increase the intensity of exercise gradually. Do not use tobacco, alcohol, weed or street drugs in any form. Practice safe sex.