For fatloss. Does it matter what I eat, unless I eat below my matinence?

I've heard people say that quality food is better but idk.
Like 1000cals of candy Vs 1000 cals of chicken,milk,meat etc.
Yes it does matter, every food has a certain nutricional value, and foods like cookies or Nutella have a crazy amount of sugar and fat