In the year 1748, William Cullen presented artificial refrigeration for the first time, at Glasgow university. This invention was however not put to practical use.
Later in the year 1823, Michael Faraday found out how to alter ammonia vapor to a liquid through compressing it ad the liquid is permitted to evaporate this process we have our modern fridges.
Carlinde a Swiss inventor invented the first refrigerating machine in 1874. He used it to cool beer. In 1877 Linde used ammonia as the liquid in the machine.