Teach means to help someone else gain a skill or knowledge, as in his grandfather taught him how to sail, while learn means to gain that knowledge yourself, as in he learned Spanish while living in Madrid. A simple way to keep them straight: the teacher teaches, and the student learns — the knowledge flows from the teacher to the learner, never the other way round.
The core difference
Teach is what you do for someone else's benefit; learn is what happens to you.
- teach — to help someone learn a skill or subject by explaining or demonstrating it: She has taught mathematics at the same school for twenty years.
- learn — to gain knowledge or a skill through study, practice, or experience: She learned to play the piano as a child.
How to tell them apart
The two verbs describe opposite ends of the same exchange: a teacher passes on knowledge, and a learner receives it. "He taught me to swim" and "I learned to swim" describe the same event from two different points of view, which is exactly why the words get muddled — especially in casual speech where "learn me" sometimes stands in for "teach me," though that usage is considered non-standard in modern English.
Keeping the direction straight helps in writing too: if the subject is the one imparting knowledge, use teach; if the subject is the one absorbing it, use learn. His grandfather taught him to sail, and in turn, he learned to sail — same event, different subject.