The denotation of a word refers to a word's literal or primary meaning. Connotation, by contrast, refers to the implied or euphemistic usage of a word. For example, take the word "hip." Hip may be used to refer to something that is trendy or fashionable, such as calling a new music genre "hip." This is a connotative meaning of the word. If a person were to say that he hurt his hip, then he would be using the denotative meaning of the word.
Words also derive meaning from their presence within a certain lexicon. A lexicon is the group of words that are associated with a certain dialect, branch of knowledge or technical understanding. For example, a computer technician might use words in her lexicon, such as mouse, java, virus, hard drive, RAM, algorithm or source code. These words mean a certain thing within this lexicon, but they may mean drastically different things outside of it, as would be the case with "mouse."
Semantics refers to a branch of philosophy that studies words, their meanings and their relationships to other words (see Reference 3). Philosophers who are engaged with semantics may study the way in which words' meanings change over time or why certain words become archaic and others remain as elements of popular speech. They also look at word meanings in terms of synonyms, homonyms, antonyms, spellings, pairs, opposites, synecdoche, metaphor, simile and metonymy.
Words also gain meanings through the use of idioms and figures of speech. For example, a person may speak of another person saying, "He kicked the bucket." This phrase is an idiom that describes a person's death, but it uses words that would not typically be associated with death, because "kicked" and "bucket" have other denotative meanings. Words derive meanings through these sorts of idioms and figures of speech, which may use old practices, folklore or fairy tales to create a new meaning.