There are two positions you can take on a futures contract: long or short.
If you take a long position, you agree to buy an asset in the future at a specific price when the contract expires. When you take a short position, you agree to sell an asset at a set price when the contract expires.
A good way to explain this is using the example of an airline who wants to hedge against the rising price of fuel by entering into a futures contract.
Say jet fuel trades at $2 per gallon. An airline expecting the price of oil to rise, buys a three-month futures contract for 1,000 gallons at current prices. The contract is, therefore, worth $2,000.
If in three months, when the contract expires, the price of one gallon of jet fuels is $3, the airline saved $1,000.
The supplier will happily enter into a futures contract in order to ensure a steady market for fuel, even when prices are high. And the same contract will also protect them if the price of fuel unexpectedly drops.
In this case, both parties are protecting themselves against the volatility of fuel prices.
There are also investors who speculate with futures contracts rather than using it as a protection mechanism.
They will deliberately go long when the price of a commodity is low. As prices rise, the contract becomes more valuable, and the investor could decide to trade the contract with another investor before it expires, at a higher price.