The slang term "being in the closet" has been used to describe keeping secret one's sexual behaviors or preference disapproved of by society; typically homosexuality, but also including various paraphilias. (The term has also been used semiseriously to refer to other personal preferences; e.g. "John Doe is a closet postmodernist, communist, etc.")
"Coming out of the closet" describes voluntarily making public one's sexual behaviors or preference, "being out" to not concealing one's sexual behaviors or preference, and "outing" for making public the sexual behaviors or preference of another who would prefer to keep this information secret.
Many people who identify themselves as homosexual, or who might prefer homosexual activities or relationships, have engaged in heterosexual activities or even have long-term heterosexual relationships. Such "heterosexual" behavior by people who would otherwise be homosexual has often been part of being "in the closet", and may be becoming less common as acceptance of homosexuality increases.
Historically, coming out of the closet has often meant losing your job, home, family, friends, religious and/or political memberships. There has often also been a real risk of being the victim of violent hate crime.
Coming out has an etiquette of its own, developed through the experiences of people who did it in a way they later decided was inappropriate and more stressful than it had to be: for instance, among other things, it's encouraged not to announce homosexuality in a fight or while drunk or delirious for any other reason; it is encouraged to leave the subject alone until the person it was announced to chooses to broach it again.
Coming out is often a gradual process. It is common to come out first to a trusted friend or family member, and wait to come out to others. Some people are "out" at work but not to their families, or vice-versa. A person might say "I'm out at work, but I'm not out to my family".
Not surprisingly, some studies have found that the degree to which a person can be "out" in a large number of life situations seems to strongly correlate with lack of stress and freedom from neurosis.
Today more homosexuals than ever are "out", and their general belief is that being in the closet is unhealthy for the individual. A common saying is, "Closets are for clothes". One major gay magazine is titled Out Magazine.