In How To Be Happy happiness is linked to values.
The first question in ethics is “what values should I pursue?” Is it my own life and happiness, or should I put others’ interests first? The second question is the “how:” How do I achieve my values? Virtues provide the answer to the second question; they are the actions necessary to achieve values, and they of course vary significantly, depending on the answer to the first question.
For many people, “virtue” conveys a chore or a duty—because they have accepted serving others as the answer to “what values should I pursue?” They follow the conventional morality of altruism that identifies actions such as charity, compassion, tolerance, and humility as virtues. According to altruism, such virtues are the means to a good life.
However, if we adopt “my own life and happiness” as the answer to the first question in ethics, the virtues guiding our actions look very different. It is our selfish interests of survival and flourishing that define virtuous action; therefore, the virtues are derived from the requirements of human survival. Lacking speed, strength, claws and fangs, we survive primarily by thinking; therefore, the primary virtue is rationality, or exercising reason (as recognized both by Aristotle and Ayn Rand). The rest of the virtues for human survival and flourishing, as identified by Rand, are aspects of rationality: productiveness, independence, integrity, honesty, justice, and pride. (Note that she didn’t consider this an exhaustive list).
And, being happy ourselves, contributes to the happiness of others, of society.