The most common mistake for learners is to use 粮食 (liángshi) when they mean “food” in general. They are not interchangeable.
粮食 (liángshi): Staple grains (uncooked or as a category). Refers to rice, wheat, corn, millet, etc. It's about agriculture, economy, and fundamental sustenance.
食物 (shíwù): Food (general term). This includes everything: meat, vegetables, fruit, snacks, drinks, and also 粮食.
主食 (zhǔshí): Staple food (in a meal). This refers to the main carbohydrate portion of a specific meal, like rice, noodles, or steamed buns. It's the closest synonym in a meal context.
饭 (fàn): Cooked rice; meal.
Example of Incorrect Usage:
*错误 (Incorrect):* 我最喜欢的粮食是牛排和沙拉。 (Wǒ zuì xǐhuān de liángshi shì niúpái hé shālā.)
*Why it's wrong:* Steak (牛排) and salad (沙拉) are food (食物), but they are not grains. The sentence implies they are staple crops.
*正确 (Correct):* 我最喜欢的食物是牛排和沙拉。 (Wǒ zuì xǐhuān de shíwù shì niúpái hé shālā.)