How did people store food in the medieval times?
Fermentation is an excellent way of preserving, and while it alters the food, unlike today's methods it does not simply destroy nutritive value. Vegetables pickled in brine in the old ways, like sauerkraut, have more nutritive value in some ways than the fresh vegetable does. Many vegetables were pickled in this way, and they were kept for months. The down side of this was that vitamin C was lost in the process, and people did not get enough during the winter. Today, pickles are pasteurized, and the nutrition is lost.
Fermentation was also used on milk products, making products like yogurt or cultured buttermilk and cheese. The cheeses could be kept for very long times, up to years in cool environments if they were covered by wax or had been put in brine before storage to produce a rind, as in the case of Swiss cheese. A cheese very like Swiss cheese predated the Middle Ages, and was made throughout.
And, of course, fermentation was used in the making of beer, wine, cider, and mead. In those days, when these are unpasteurized, they had more nutritive value than they usually do today.
Eggs could be preserved by covering with hot wax, if they had been left unwashed. The idea of washing eggs had not occurred to the people of that age, so waxing eggs was pretty easy. Of course, wax was usually not free, so waxing eggs was only done for special purposes. Without wax, they could be kept easily for quite a while in cold weather, or for a few days in hot weather by putting them in a jar in a hole in the ground.
Fruits were dried for the winter, though with a loss of vitamin C and other important nutrients.
Meats were often preserved by drying, salting, or smoking. Ham, smoked and hung up, could last for quite a while. Honestly, I do not know how long.
Fish was also salted, dried, or smoked. Fish was often caught far out to sea, in ships that would stay out for weeks at a time. The fish was salted and brought to port in that form. Salt fish was shipped quite far inland, either by boat, up rivers, on carts, or packed.
The fact that medieval people did not have refrigerators did not mean they did not use cold for food storage. They were able to store fresh foods longer in the winter, and took advantage of that. In some places, especially in the mountains, food was stored in caves that were particularly cold. On the north sides of mountains, these could maintain ice all year in some cases. Ice houses commonly existed in Italy by the 16th century, so it is possible they existed in the Middle Ages there. Indeed, there is record of "snow shops" in ancient Rome, where one could go and buy snow or ice that had been collected in the mountains.
One thing about medieval history is how much we do not know. To understand this, you might imagine what we know of ancient times, understanding that fewer than 600 complete books exist from the period, but there were the equivalent of about 100,000 modern books burned in the worst of the three fires that destroyed the Library at Alexandria. Ancient authors, of whose writings we have less than 1%, were far more prolific than those of the Middle Ages. There is a lot we do not know. We do not know, for example, why certain structures were built, and among these are room sized holes in the ground with small entrances. They might have been hiding places, but it has been suggested that these might have been root cellars for storing root vegetables and fruits such as apples.