It is rarely an exact science. I just do the best guessing that I can - and learn a lot through trial & error.
It helps that I tend to eat a fairly stable diet - same kinds meals throughout the week, sometimes different stuff on weekends. What I like about MyFitnessPal is that the foods I eat regularly just pop up and I can quickly add them.
I have guesstimated a lot of stuff. For example, I often will get a rotisserie chicken and then use bite-size pieces of the chicken breast in a salad for lunch I just estimate that it's about 1/2 the size of the full breast - and you can find the calorie count for a rotisserie chicken breast in the app and then just make it a 1/2 portion.
If you generally overestimate a bit, then you'll make more progress losing weight.
