Not by learning rules, but by coming to know the limited number of relationships your words, phrases, and clauses can enter into, and becoming alert to those times when the relationships are not established or are unclear: when a phrase just dangles in space, when a connective has nothing to connect to, when a prepositional phrase is in search of a verb to complement, when a pronoun cannot be paired with a noun.