I don't think that what I say is in any way controversial but apparently some people need to hear this.
The only possible way to lose weight is to eat less calories than you burn. There are many possible ways of making sure you are eating less than you burn and there are many reasons why someone would not lose weight no matter how little they eat, but ultimately - this and only this is the reason why your body changes weight long-term.
It easy to know your caloric intake
It's true that it's impossible to accurately know how many calories you consume. But if you count every single thing you put in your stomach, the maximum overestimation is 20% error margin allowed by law. On the other side, the underestimation can be 20% less just because the legally allowed error margin goes both ways and it can be far, far less because of the difference between what is measured in the lab - total amount of calories in a food item - and what each individual body absorbs.
Unless you are eating pure sugar (or worse, drinking 11% sugar), when you look at the label, there is a better chance that you will gain less calories than stated on the label than that you will gain more than on the label. If you eat a lot of different foods, as you should on any diet, then hopefully all the error margins will equal each other out. And if you want to have complete control over your calories and remove all guesswork from the equation, you can just assume you absorb all calories you consume and increase all amounts on labels by 20%, then you know with 100% certainty the upper limit of calories you consume.
It goes without saying but if you don't count a single bite or sip that enters your body and don't weight everything, you don't really know how many calories you consume. Nothing wrong with not counting everything if you are losing weight regardless, you can absolutely lose weight by guesstimating everything. In most cases when people don't lose weight and don't measure accurately their entire caloric intake, the problem turns out to be eating much more calories than someone guessed by weighting peanuts in hands, recording only 50+kcal meals and not counting drinks. Only when you know you are not making by far the most common mistake in calorie counting, is it worth exploring other possible reasons why you are not losing weight.
It's not that hard to know your caloric output
There are online calculators that can tell you how many calories you burn each day based on your height, weight and activity level. They are very inaccurate and can only give you the best guess. There are devices that measure how many calories you burn during exercise. Those are so inaccurate, you are better of just assuming you burn 0kcal during exercise and never eat more because you exercised. Exercise might become inevitable when hitting a plateau and then counting calories will make more sense but so many people overeat because they overestimate how many calories they lost during exercise that counting them as part of your deficit is a dangerous game not worth playing.
But there is good news - your long-term average TDEE doesn't change much unless there is a change in your body or in your habits. So if you know your exact caloric intake and you know how your weight changed over few weeks, you will know if you eat more or less than you need to create a deficit and how big (approximately) that deficit is. Yes, it is true that TDEE changes when you consume different amount of calories but thankfully we don't need to care about that - all we care about is the difference between calories consumed and calories burned and this is directly related with long-term changes in weight. And for most healthy people, as you lower your caloric intake, the difference between calorie in and calories out grows.
This is the true power of "calories in v. calories out" - if you are losing weight, it's always because you absorbed less calories than you used and if you gain weight, it's always because you didn't burn enough calories compared to what you ate. If you know your caloric intake and your weight history, you also know your average caloric expenditure over that period. Some people will try to say that CICO doesn't work because TDEE is inaccurate and can change because of disorders or because some disorders make it completely impossible to lose weight. Those people have it completely backwards - if you truly, being diligent and without lying to yourself, without starving yourself and torturing yourself with excessive exercises, counted that as your caloric input is becoming lower, nothing ever changes about your weight - then you will know that something is not alright because your TDEE is well below what it should be for a person of your size and you should consult a doctor.
It's simple to lose weight by eating less than you burn (for most people)
I understand the frustration of not being able to lose weight no matter what. But the truth is that for vast majority of people, lowering consumed calories below what their body needs is what works. For some people, lowering caloric intake makes their body burn that much less calories. But when it comes to general advice about losing weight for strangers on the internet, it's far more likely that you are not counting your calories correctly (be it exercise or consumption) or you are mistaken about your TDEE. Especially if there are no other warning signs, like chronic fatigue, fainting, excessive sleep, etc. Just like with pregnancy, you wouldn't advice a fertility clinic to someone unless they already tried for months and were tracking periods and fertile days. Most people can have kids without ever seriously trying and most people can lose weight by being honest with themselves, counting calories they consume, exercising if necessary and weighting themselves regularly.
All the exceptions to the rule of "eat less, weight less" don't disprove CICO because CICO is the fundamental law determining our weight change. The entire point of CICO model is figuring out the CO part by monitoring caloric intake and weight change and adjusting intake accordingly. I'm repeating myself here, but this is the most important part of this post - if you have a disorder that makes it impossible for you to lose weight, it doesn't mean that CICO doesn't work or in any way failed you - CICO model worked exactly as it's supposed to, showing you that CO falls too low compared to your body type and CI for a healthy person. And any medication or treatment that fixes that problem, will fix it by raising the CO part to a healthy level, which you can still measure using CICO model.
If you ever try to argue that you know your caloric intake and your TDEE and that CICO doesn't work because you are not losing weight, please don't get mad when you receive a snarky comment about thermodynamics and please don't post on this subreddit about how mad you are about those comments. If CICO doesn't work for you, you are either: 1) mistaken about you CI, 2) mistaken about your TDEE (including an unhealthily low TDEE caused by a combination of a diet and a health problem) or 3) the universe made an exception in the laws of physics just to spite you.
And if you post snarky comments about thermodynamics when a person is honestly lost and looking for advice, not trying to disprove reality, then also please don't.