A happiness pill or happy pill was the slang term for the elusive concept of a type of medication that provided the user with joy. However, by the 23rd century, scientists knew it to be impossible.
In 2267, upon hearing Leila Kalomi's description of the Omicron spores' effects (though unaware of the nature of the substance), Spock reminded her of this fact. (TOS: "This Side of Paradise")
Despite this, later that year, James T. Kirk asked Doctor Leonard McCoy whether he got a pregnant Eleen to let him examine her by giving her a happy pill. McCoy replied, "No, a right cross." (TOS: "Friday's Child")