Coin type batteries, especially if you buy them at your local drug store, are overly expensive. You will often pay 4$ or 5$ for a battery that is worth about one tenth of that. Sure there are very well known brands like Duracell or Energizer, but does it really make a difference ? This is a good question that I won't try to answer here.
The point is that if you buy well knows brands, you are confident that this is good quality, and there is a human readable date code on the battery indicating when it was manufactured, so you know that you are not buying old stock.
If you buy your coin type batteries in a dollar store or on ebay, you get really great deals, but they quality is questionable, and most importantly, you want to make sure that this is not old stuff that will not work out of the box.
In order to know if the battery is still good, there is always a date code on the battery that will either indicate the manufacture month and year, or the expiry month and year.
For Maxell batteries, you can see
this article on how to interpret the date code.
For other battery brands, the process should be very similar. You can search the web for the exact brand you have in your possession.