Fat is good if you eat the right kinds of fats and your consumption of unhealthy fat is limited.
The issue is more that people eat too much fatty food, a specifically unhealthy fats.
On the other hand sugar is probably never good for you and you should aim to reduce it as much as possible.