Futures are the agreed transaction prices at some future time. Therefore, the increase in spot prices will make money by buying futures and make up for the losses caused by the increase in spot market prices. On the contrary, the drop in the spot market price will make the sale of futures to make up for the losses caused by the drop in the spot market price.
This is a mechanism for futures to avoid price risks.