There isn't a way to preserve food with bacteria but there are ways to preserve food without bacteria such as prevention of contamination (aseptic technique), removal or reduction of microorganisms, the use of high temperature, the use of low temperature drying, fermentation and pickling, and chemical preservation.