Sodium nitrite is often used in cosmetics as a preservative to prevent bacterial growth and extend the shelf life of products. It helps maintain the stability and effectiveness of skincare and haircare formulations.