Many pre-freezer civilisations took ice or snow from higher regions and used it as an ingredient or in order to cool desserts.
I know that Romans and the Greek did this and that European crusadors brought home the recipy from the Arabs. But since you didn't ask for a specific time and place, I can tell you how it was done in early 19th century Germany (and probably earlier, too).
They received their ice from the mountains and/or cut it in the winter from frozen lakes and stored it in deep, cool cellars (you can see examples here: https://www.monumente-online.de/de/ausgaben/2014/5/ewiges-eis.php . If you speak German you can also find more information on ice in pre-industrial times). When they took it into the kitchen in order to use it, they often mixed salt into ice or ice water, which results in a drop in temperature. You can try this yourself, it's a very popular experiment and you'll find guides on the internet. Many cooks use this trick until today.
I do own a cook book with recipies from the Bavarian court (the cook's name is Johann Rottenhöfer), from early 19th century, where ice and ice-salt-mixtures are frequently mentioned as a cooling method for desserts and cold beverages.
As you can imagine, before the invention of freezers, this was luxury and only available for the wealthy.
This previous discussion of the subject may answer your question.