How do we know that which food is male and which is female? Do we need to learn them or is there any trick involved
You'll need to learn them, unfortunately. It gets easier further down the course, because you'll start to notice patterns in the words, but there are many exceptions to the rules.
Recently, another user was placing images of moustaches and skirts on images of the masculine and feminine nouns respectively. I can't find the link now, but maybe something like that picture association would work for you if you find it too difficult.
Bonne chance :)
MOST female nouns ending in '"E" and those that end in "ion" and "son" are feminine. Most of the others are masculine
Well I guess what I read was misleading but I did say "nouns" and not words in general... Merci beaucoup pour la lists! Je vais l'apprendre.