William Blake wrote, "Fun I love, but too much fun is of all things the most loathsome. Mirth is better than fun, and happiness is better than mirth."
Today happiness is viewed as a mood, a feeling. This understanding isn't wrong as much as it is shortsighted,as implied by Blake.
Moods shift and feelings change. But true happiness is the accumulation of soul-sustaining relationships. While feeling happy may differ from day to day, if the over-all direction of your life has been in cultivating good relations, then you can be happy in the deeper and more permanent sense.
Modern conceptions of happiness are misleading because the focus is in the wrong place. In pre-modern and traditional societies, happiness came about because people were tied to something outside themselves. Connections to family, fellow citizens, and clan, actions performed and attitudes developed, and duties carried out were the constituent and necessary components of happiness.
In the pre-modern world there was no "self" or "personality" as we now conceive of it, an autonomous personality making self-referential decisions. A person was part of something else, not apart from it. There was a profound recognition that to be separated from others and the community was unsettling and inhuman. Short of death, nothing was worse than being shunned or sent into exile.
Religious excommunication served the same purpose: people were removed from their religious moorings, being put outside the community and unable to partake in religious necessities. Even today the most severe punishment, short of torture or execution, is solitary confinement. Humans are born into a community and from that community they are formed. In this sense, society is prior to the individual, both temporally and psychologically.
Every human inherits a culture, with all its written and unwritten rules, and lives in a story written by predecessors. This isn't to deny a common moral heritage by suggesting that humans are nothing more than creatures of socialization and historical circumstances, but it is to say that loneliness, isolation, and alienation are antithetical to happiness.