Short answer: long-term practice of weighing products. Have you noticed how sellers in the market put on the eye about as much as the buyer asked? Well, usually a little more, and then ask "a little more will go?" :)
To begin to determine the weight by eye, I weighed everything I ate on a kitchen scale for a year. This, of course, was not an end in itself. I found out that I had learned this quite by accident: in a restaurant I argued with a lady about the weight of a piece of fish, and it turned out that I determined the weight with an error of 5 grams (then they asked the waiter to weigh the portion in the kitchen). But even after this discovery about my new abilities, I weigh everything on the scales, because it is easy to make a mistake. But if there is no possibility, I figure it out and hope for my experience.
Another tip: find on the Internet the standard weight and calorie content of dishes that you often eat in cafes and restaurants, and write down notes on your smartphone. Calorie content is even more important, because weight is often written, but calorie content is much less.
You will never determine the exact figure by eye, even if you use all these rules for comparing "cams", "palms", etc.
There are studies that people on a diet underestimate the calorie content of their daily diet, and those who want to gain weight - overestimate. The effect is purely psychological. Surely, you have a friend who says that she eats a blade of grass and a drop of dew and at the same time the weight only increases.
If "by eye" you counted 1500 kcal, then in fact there there may be 2500 kcal. So if you need it exactly, then buy a gram scale and weigh everything before putting it in your mouth, maybe after a while you will start to more accurately determine the mass of food at a glance, but still, contrary to your goals, you will underestimate or overestimate it.
PS Here is what Denis Borisov says about this (CAUTION MAT! 18+)