Early economies started out as a barter system -- a simple system of trading one good for another. This system, however, did not designate a standardized value for each item. For example, there was no easy way to determine a value of a boat based on a number of fish. This standard was set when gold was used in all exchanges, but gold was a scarce and inconvenient resource -- it could not be easily traded. Early government systems then started using coins which were set against the standard value set by gold as a modern form of money. This idea of a standard value became the foundation of all the money in an economy.
For any transaction to happen, there must be a double coincidence of wants; both buyer and seller must want what the other has to offer. In previous barter situations, the chance of this happening was very small as there was no way to ensure that the seller personally wants the good being offered in the exchange. Money fulfills this requirement by acting as an accepted medium for all transactions. Because money can effectively buy anything in an economy, it fulfills the seller's wants even if the buyer is not directly offering it.
The unit of account is based on the idea behind the gold standard. In early economies, all forms of money equated to a specific value in gold. This allowed for a pricing system for all goods to be set. While current money is no longer based on the gold standard, it is based on a common economic measure set by the government and affected by the growth of the market. This common measure allows a person to make logical and sound decisions about how much a product is and how many products he is able to purchase.
A problem with using goods in previous barter systems was that some goods expired over time. For example, while an abundant number of fish could feasibly buy a boat, these fish would rot and spoil long before the time value of the boat was met. Money, on the other hand, has a definite value; by itself, it does not change in value. Certain external factors such as economic growth or government policy can affect the value of money, but the overall value is mostly stable in a typical economy. Additionally, large amounts of value can easily be stored and transferred by using money, especially with the current advances in banking technology.