Money is anything which is commonly accepted as a medium of exchange and in discharge of debts.
People exchange goods and services through the medium of money. Money by itself has no utility. It is only an intermediary. The use of money facilitates exchange.
Both parties have to agree to sell and buy each other commodities. This is known as a Double coincidence of wants.
Direct exchange of goods against goods without use of money is called barter exchange (i.e. exchange of goods for goods).
In a barter system where goods are directly exchanged without the use of money, the double coincidence of wants is an essential feature.
Since money acts as an intermediate in the exchange process, it is called a medium of exchange.