You learn the meaning of a word from its context in the sentence.
Literal
Sentence [possessive-の] context [from-から] word [possessive-の] meaning [object-を] know.
前後関係 means 'context' — literally 'before-after relationship,' referring to the surrounding words. A useful vocabulary item for discussing language learning itself.