I've tried a mixture of both. A good friend had a copy of The Obesity Code: Unlocking the Secrets of Weight Loss, which I quickly read through a couple of hours. The author claims it's all diet, but understanding how your body responds to hunger requires understanding a lot of factors.
Either way, when I was younger I tried a keto diet and dropped 35 pounds in five weeks. The accelerated rate of weight loss lessened after that initial bump.
I'm personally a fan of diet and exercise. But I strongly encourage constant work, lifestyle changes, and working on practical results. So many of the models of what we should look like are unrealistic for most people.