Arguably the most famous line in JFK's inaugural address is an example of what's called antimetabole. This is where a phrase or expression or phrase is repeated, but in a different order. For example:
And so, my fellow Americans: ask not what your country can do for you—ask what you can do for your country.
Anaphora is a rhetorical device that involves the repetition of one or more words at the beginning of consecutive phrases, clauses, or sentences. It's particularly useful for emphasizing a very important point, something that the speaker wants to stay in the audience's memory:
Let both sides explore what problems unite us instead of belaboring those problems which divide us. Let both sides, for the first time, formulate serious and precise proposals for the inspection and control of arms—and bring the absolute power to destroy other nations under the absolute control of all nations. Let both sides seek to invoke the wonders of science instead of its terrors. Together let us explore the...
(The entire section contains 935 words.)