Use e.g. when introducing a few non-exhaustive examples; use i.e. when clarifying or restating an exact equivalent.
Memory aid: e.g. = "example given"; i.e. = "in essence". In formal American English, both abbreviations take periods and are followed by a comma.
"Choose a citrus fruit for breakfast (e.g., grapefruit, orange, or lemon)."
Provides three sample fruits from a larger group of options.
"The patient suffers from nocturnal enuresis (i.e., bedwetting)."
Restates the technical medical diagnosis in plain English.
Because this specifies the exact and complete scope, "i.e." is required.
Academic parentheticals, business contracts, technical documentation, and footnotes.
Commas separate clause boundaries, set off parenthetical non-essential details, and prevent misreading.
Semicolons connect closely related independent clauses; colons introduce explanations, lists, or amplifications.