Food is preserved by soaking it in vinegar or brine, which creates an acidic environment that prevents bacterial growth.