The phrase ”cost of carry” is summarizing some of the factors which affect the relationship between the future and the spot price. It is the cost someone has to take in order to hold a position in the actual asset.
A commodity has no dividend yield (q) so the cost of carry can be estimated by adding the risk free rate and the storage cost, whereas an index has no storage cost so its cost of carry can be found by subtracting the dividend yield from the risk free rate. In that sense if the dividend yield is higher than the interest rate we have to pay to borrow money to open a position, then it is profitable to have an outright position in the underline asset, whereas if the opposite is true then it is better to hold a long futures contracts position in order to pay less interest (we borrow a smaller amount due to leverage).
Conclusively, the price of a contract is relevant to the cost of carry and the convenience yield (where it exists).