Commodity money is form of currency in which the value of the currency comes from the material which was used to to make it. Eg. gold, silver, livestock, and other materials .They used to be used as currency in historical days.
Fiat money is used nowadays, examples of fiat money are the Nigerian Naira, the United States dollar, British pounds etc. They are money whose value is based on government guarantees but has no inherent value.
Fiat money is at risk of inflation and deflation because its value is not intrinsic. Changes in public confidence in a government issuing fiat money may be enough to make the fiat currency worthless. Commodity money, however, retains value based on the metal or other material content it has.
According to Investopedia, Commodity money has intrinsic value but risks large price fluctuations based on changing commodity prices. If silver coins are used, a large discovery of silver may cause the value of the silver currency to plunge. For convenience and to avoid these price changes, many governments issue fiat currency. Initially, many fiat currencies were backed by a commodity. Backing a fiat currency with a commodity provides more stability and encourages confidence in the financial system. Anyone could take backed fiat currency to the issuing government and exchange it for a certain amount of the commodity. Eventually, many governments no longer backed fiat currency, and the money increasingly took on a value based on public confidence. As of 1933, U.S. citizens could no longer exchange currency with the U.S. government for gold. In 1973, the U.S. stopped offering foreign governments gold in exchange for U.S. currency. Many governments no longer think commodity money is in the best interests of the public.