These two helpful abbreviations are often used interchangeably, a sorry mistake that impoverishes the language.
The term e.g. means "for example."
The term i.e. means "that is" or "by which I mean" or "in other words."
To illustrate: The so-called "method actors" (e.g., Marlon Brando and James Dean) electrified audiences in the 1950s. Compare that sentence with Artists like Marlon Brando and James Dean (i.e., the so-called "method actors") electrified audiences in the 1950s.
Sometimes the right choice requires careful thought, as in this case: Certain members of my family (i.e., Mom and Uncle Jake) are vegetarians. In that sentence, the i.e. tells us that Mom and Uncle Jake are the only family members who don't eat meat. But what if we replaced i.e. with e.g.: Certain members of my family (e.g., Mom and Uncle Jake) are vegetarians. Now the sentence indicates that there are other vegetarians in the family besides Mom and Uncle Jake.
That is no small difference, and it highlights the dissimilarity of i.e. and e.g. Confusing one for the other can result in misunderstandings at best and nonsense at worst. So remember to use i.e. when further identifying a subject, and use e.g. when giving specific examples of a subject.