Frank Sherwin wrote The Wax That Taxes Darwin which appears at the ICR website. It's a short but informative article about earwax. As Sherwin points out about 4,000 glandular cells are involved in the production of earwax which he describes as a "brownish-yellow substance called cerumen." Sherwin also notes that earwax "contains anti-microbial proteins, squalene, long-chain fatty acids, and peptides (molecules consisting of two or more amino acids)." Quoting Sherwin:
Earwax protects the ear by trapping dust particles, bacteria, fungal spores, sand, and dirt, preventing them from entering inner recesses and possibly damaging the ear. If they do gain a "foothold," disease-causing micro-organisms (e.g., E. coli) are subject to a veritable smorgasbord of defensive compounds such as lactoferrin, beta-defensin-1, cathelicidin, beta-defensin-2, lysozyme, MUC1 and secretory component of IgA (a major class of antibody) found in the cerumen.2 These are highly complex compounds that defy a naturalistic origin explanation. But not only does earwax attract and trap debris --its bitterness also repels insects, mites, and other creatures.
Sherwin rightly credits God with the design of a wondrous substance we sometimes think of as a nuisance. Yet earwax has a valuable protective purpose.