How do you count calories for some of the garbage food?
Like what? If I make a recipe, say a Strawberry dream cake, I put all the ingredients in myself and therefore know the exact caloric content of the whole cake. You can slice the cake into however many equal pieces and just divide from the total caloric amount, what each piece would be.
Or
You can weigh the entire cake and make a proportion calculation. For instance, if the cake weighs 3000 grams and the calories are 6000- say you just pull off a piece and its 253 grams. Simply multiply 253*6000 then divide the result by 3000 which will give you 506. A 253 gram slice of that cake is 506 calories.
You can apply these methods to any food.