Nutrition can be both complicated and completely simple.
If you want to lose weight or gain weight it is all about your energy balance in and out of your body and creating that calorific deficit for either goal and consistently keeping that deficit whilst coupled with training. Now that’s not my own opinion, that’s just science.
Few things that are important: (but to be honest, not for everyone)
Your BMR (Basic metabolic rate) is the amount of energy you expend whilst at rest. So whilst just going about your day.
Your TDEE (Total daily energy expenditure) is the amount of calories you burn each day including your BMR.
Finding your TDEE is important when you have a weight goal.
Your TDEE is found by first figuring out your BMR then multiplying that value by activity multiplier.
If your calorific intake stays below your TDEE for a consistent period of time. You will lose weight. If your calories are above your TDEE and coupled with the right strength & conditioning training and diet you should gain lean muscle. Simple as that.
Macro nutrients and more can help impact your diet but they are not essential in a weight loss journey. They become more prevalent during a weight gain journey, which is generally someone looking to gain lean muscle mass.
I have tried to limit myself eating foods in the past and it just hasn’t worked for me and that is important because you will need to find what works for you. I would always advise a balanced diet over limiting foods or stopping foods completely. Just think about what your putting in your body vs the energy you put out.