What is an example of play on words?

An example of a play on words is the joke “He had a photographic memory but never developed it.” The word “developed” can refer to developing skills or developing photographs.

This particular form of wordplay is called a pun, creating humor using words or phrases with multiple meanings.