The term for a word opposite in meaning to another word is an antonym. For example, hot and cold, early and late, and expand and contract can function as antonymic pairs.
Antonyms are part of lexical semantics, the study of how words relate in meaning. Some are complementary opposites, such as alive and dead, where the meanings are often treated as mutually exclusive. Others are gradable opposites, such as hot and cold, because intermediate states like warm or cool are possible.
A third pattern involves relational opposites. Words such as buy and sell describe the same situation from contrasting perspectives, while parent and child express linked roles within a relationship. These pairs are opposites, but they do not always behave like simple yes-or-no contrasts.
Antonym is often confused with synonym, which means a word with a similar meaning. A homonym shares spelling or pronunciation with another word while having a different meaning, and a homophone shares pronunciation but may differ in spelling and meaning.