An appositive is a noun or pronoun — often with modifiers — set beside another noun or pronoun to explain or identify it. Here are some examples of appositives (the noun or pronoun will be in blue, the appositive will be in red).
An appositive phrase usually follows the word it explains or identifies, but it may also precede it.
Punctuation of appositives
In some cases, the noun being explained is too general without the appositive; the information is essential to the meaning of the sentence. When this is the case, do not place commas around the appositive; just leave it alone. If the sentence would be clear and complete without the appositive, then commas are necessary; place one before and one after the appositive.
Here are some examples.
Here we do not put commas around the appositive because it is essential information. Without the appositive, the sentence would be, "The popular US president was known for his eloquent and inspirational speeches." We wouldn't know who the president is without the appositive.
Here we put commas around the appositive because it is not essential information. Without the appositive, the sentence would be, "John Kennedy was known for his eloquent and inspirational speeches." We still know who the subject of the sentence is without the appositive.
Here we do not put commas around either appositive because they are both essential to understanding the sentence. Without the appositives, the sentence would just be John Kennedy was quite different from John Kennedy. We wouldn't know what qualities of John Kennedy were being referred to without the appositive.