How it's possible to measure temperature 2000 years ago?
Sans the technology used by Bill and Ted ("Bill and Ted's Excellent Adventure"), it obviously is not possible to directly measure the temperature from yesterday, let alone 2000 years ago, or longer. What is used are "proxies", things that can be measured today that serve as stand-ins for things such as temperature in the past.
One example of a proxy is the amount of oxygen-18 in the ice in Greenland and Antarctica. Water with two hydrogen atoms and one oxygen-16 atom has a boiling point of about 100° C. Water with the oxygen-16 atom replaced by an oxygen-18 atom has a slightly higher boiling point. This means that heavy oxygen water evaporates less readily but precipitates more readily than does normal water.
This in turn means that the fraction of oxygen 18 versus oxygen 16 in the water and air bubbles in the ancient ice in Greenland and Antarctica are indicative of the climate at the time that that ice and those air bubbles formed. Despite being a half a world apart, the ratios of oxygen-18 to oxygen-16 over time are highly consistent between Greenland and Antarctica. The consistency of these measures at half a world apart are almost universally taken as being a proxy for something else, and that something else is climate.
There are many other proxies for past climate. There are other isotopes that serve as proxies. The amounts and kinds of pollen in mountain glaciers and ice sheets form yet another kind of proxy. The kinds of plants that do grow in some locales and how fast they do grow is highly temperature dependent. Like ice, buried muds in the oceans also show variations in various proxies. Climate scientists put these proxy measurements together to arrive at the temperatures from 2000 years ago, and even further into the past.