Some foods I know, eg. oil 9kcal/g, but mostly I just check the label. Every food in the EU has the calories/100g or calories/100ml on the label. If it's not packaged, I look it up it FDDB [1].
[1]: https://fddb.info/db/de/produktgruppen/produkt_verzeichnis/i...