We can pretty often read something like… "He owned this sum of silver/gold which is equal to this sum of dollars in our time."
But how is this calculated? How can you know what a 1000 dollars was in Roman Empire for example? By comparing prices for some goods? But is it an adequate method?
It would be inadequate if there weren't so much data collected over the centuries. The Roman Empire is a very well documented period. There are detailed price lists on what the Romans thought was essential, very similar to ours. There is also plenty of information on how much they had to pay for lodging; clothes; books; as well as horses, private houses, and good wine. Real estate values are well-known as well. The average income of a Roman citizen belonging to this or that milieu is also known.
Here's an interesting link that has a few tables (prices and incomes of various Roman professionals): Ancient Roman prices and salaries
The value of a currency at any time is measured by a figure called the Consumer Price Index: this takes into account the price of lots of different things and comes up with a single figure for that currency. This can then be compared between eg the dollar now and the pound now, or the pound now and the pound 5 years ago, or, a defunct currency.
One way to think of this is to imagine a supermarket (in the country and time in question) that sells everything at a standard, average sort of price (perhaps the RRP), and you go to that supermarket with a shopping list. How many of the currency in question would it cost to get the full shopping list? You can sort of go as complicated as you want when calculating the CPI, bringing in more complicated factors such as weighting for different categories of item. But that's the basic idea. If you went to the supermarket now it would cost more than it would 10 years ago to get the full list, and that is how we say there has been "inflation".
Accurately calculating the CPI for a historic currency requires good records of the prices of common goods at that time. Obviously the list of goods will differ (hardly anyone buys wagon wheels any more) but historians can (probably) agree on how it would be calculated for that period, ie which prices are examined and how they contribute to the final figure.