Methylparaben is a common preservative used in cosmetics to prevent the growth of harmful bacteria, fungi, and other microbes in products such as lotions, creams, and makeup. It helps extend the shelf life of these products and ensures they remain safe for use.