"He cooks food tonight."
Translation:Han laver mad i aften.
I think your understanding of when to use the article is just fine. The problem here is that "mad" is used as an uncountable noun
It behaves just like in English. You can say
he cooks a duck --> han laver en and (you would use tilbereder in danish but that does not matter)
But you can not say
He cooks a food (or any number of food)
the "a" is dropped just like "en" is dropped in danish. Other verbs that drop the article are things like water, iron, clay and gold
In danish you can konjugate mad (en mad, flere madder alle madderne) but the meaning change now it is about slices of bread with some topping on
I hope this helped