I have been storing comfort food for times of need. Use a clean canning jar with new lids and rings. Put the food into the jars to within 1/2 to 1/4 inch from the top. Add an oxygen absorber to the top of the food, put on a new lid and screw the band down tightly. Within several hours, the jar will be sealed and will last many years. The food inside will be like new when opened. I have stored M&M's, chocolate chips, brownie mix and cake mixes. With the brownie mixes and cake mixes, I added one unflavored gelatin pack per egg required with the mix. Water plus the gelatin is equal to an egg when baking. I write the directions and what the mix is on the lid.
Oxygen absorbers can be purchased from Amazon for a little around 10 cents each. Or, if you live near an LDS cannery, you can purchase them there. You must also buy a clip to keep the extra oxygen absorbers free from outside air.
You can also store many other items this way. Watch for candy on sale after holidays and store them this way.