Ever look down at your fingernails or toenails and see yellow, chalky material hiding inside? If you're thinking, “Gross, what’s that?," don't freak out: it’s actually pretty common and treatable.

That chalky substance is likely keratin debris, which is formed when keratin protein (a.k.a. fibrous protein found in the nails and outer layer of the skin) breaks down, usually due to fungal infection. If left untreated, it can spread to other areas. Basically, it’s a yellowish, thick, and chalk-like substance that appears on the nails and it’s usually sharp and brittle to the touch.

While it might sound gnarly, the condition is fairly common and accounts for about half of all nail disorders, says Sonia Batra, MD, MSc, MPH, a dermatologist in Santa Monica, California, and co-host of the television show The Doctors.

“Nail keratin debris results from a fungal infection of the nail. In medical terms this is called onychomycosis or tinea unguium,” says Batra.

The fungal infection breaks down the keratin in the nail to form a white or yellow chalky substance under the nail plate.

"As keratin debris spreads under the nail, the nail plate typically becomes lifted up off of the nail bed. This separation creates a warm, moist pocket, which is even more conducive to infection,” Batra explains.The nail itself will then take on a white or yellowish color.

The nail plate itself becomes thickened from fungal infection, with crumbly, chalky keratin debris under the nail. The nails are often more fragile and jagged, she says, making it easier for them to catch on clothing or other materials.

Related: 7 Ways to Avoid Getting a Gross Toenail Fungal Infection

To prevent keratin debris from forming, you must take pains to avoid getting a fungal infection. Keep your nails clean and away from germ-filled areas, and wear flip-flops or shower sandals in moist areas, such as a public pool or shower, Batra says. When you get out of the shower, thoroughly dry your feet so moisture does not collect between the toes.

“If a fungal infection of the skin occurs (commonly known as athlete’s foot), use an antifungal cream to treat it before it spreads to nails. Also, cut nails short to prevent fungus or bacteria from finding a safe harbor under the nail,” she suggests.

If keratin debris doesn’t go away with time, you might need some extra intervention. “Some dermatologists and podiatrists treat toenail fungus and the resulting keratin debris with lasers,” Batra says. “A near infrared laser beam can be used to pass directly through the nail and vaporize the fungus, yeast or mold that is causing the infection." The treatment usually requires two to four sessions to sufficiently kill the fungus; when completed, a healthy nail usually grows back between 9 and 12 months.

Your doctor might also prescribe topical antifungal gels or creams, lacquers and liquid solutions that can be applied topically to the nails, or oral antifungal treatment drugs, such as Terbinafine or Itraconazole, she says.

Above all else, if you're not experiencing any toenail pain, do not try to remove the debris yourself. "Aggressive digging under the nail may worsen the ‘pocket’ for infection,” she says. So if you think you have nail debris, don’t freak out — simply head to your dermatologist to figure out the best treatment plan.