Before than the introduction of the money, the only way to exchange goods was the barter, that is the direct exchange of goods with goods. Barter was easy but with many problems such as time bonds. People who needed to exchange goods of different kinds, could do it only when both would have been available in the same place and time.
For instance a barter of oranges and wheat, since they have different times of ripening, was very difficult and then not advisable.
Next instead of the direct barter people starts using a third value, which was intended as "bridge-value". This allowed to extend the possibility of exchange further the contemporaneity of finding, and to make indirect exchanges. This "third value" became soon intended as precised manufacturing of some metals, in particular gold. Thence, it was possible to sell pigs to have in exchange an amount of gold pieces to buy wheat at the moment it was ripe.