Barter is useful when two people each have something the other wants, so they agree on an amount of stuff and then swap it. This can also happen with services, for example a plumber can fix a tap in a winery and be given a crate of wine.
The problem with barter is one person may not want what the other person has. For instance, Bob needs a new pair of shoes and John has those shoes. But Bob has eggs and John needs milk. This is where money becomes useful because anything can be traded for a set amount of money. Bob could pay John for the shoes and John could go to the store and buy some milk.