Mucus is produced by specialized cells known as goblet cells and mucous glands. Goblet cells are scattered among the epithelial cells of the respiratory and gastrointestinal tracts, while mucous glands are found in the submucosal layers of these tracts. Both types of cells are responsible for the synthesis and secretion of mucus, ensuring that the epithelial surfaces remain moist and protected.