When you inhale you breath in oxygen, your body then adds carbon to that and you exhale CO2
With every exhale you're literally losing carbon, when you eat you add carbon back into your body.
Burning wood on the fire works the same way, wood is carbon and when burnt in a fire it gets added to Oxygen and you get CO2
A fire and your metabolism both just take carbon and "burn" it with oxygen releasing CO2
You're basically a big bucket of carbon and water with a slow leak.
So if you eat less "carbon" in a day than you breath out, you'll lose weight