The idea that happiness-maximization is the criterion one should use in deciding what to do and how to act has probably been the most popular ethical view throughout history.
In opposition, Nietzsche insists that happiness should not be your goal.
For example, in his magnum opus — Thus Spoke Zarathustra — his protagonist declares:
“Do I strive after happiness? [No,] I strive after my works!”
And in Twilight of the Idols, he explicitly states that:
“Man [should] not strive after happiness.”
At this point, any philosopher worth his salt asks: “But what exactly does Nietzsche mean when he says these things?”