As a general matter, the rarer a coin the more it is worth. Note that rarity has little to do with the age of a coin. The condition or grade of the coin will influence its value. The better the condition a coin is in, the higher will be its assigned grade and the more it will be worth. An uncirculated coin that is in flawless mint state might be worth hundreds times more than the same coin in good condition but which has been circulated.
Many coins have a bullion value determined by the value of the precious metals it contains.
A gold, silver or platinum coin does not generally sell for much less than its melt value. The demand for the particular coin, or how many collectors want it, will also greatly influence coin values. Some coins that are relatively plentiful may command higher prices than scarcer coins because the former are more popular with collectors. However, even though the 1798 dime is much rarer than its 1916D counterpart, the 1916D coin sells for significantly more. This is because many more people collect early 20th century mercury dimes than dimes from the 1700's.