In her book Little Town on the Prairie, Laura Ingalls Wilder records her mother giving some words of advice:
“If Wisdom’s ways you wisely seek,
five things observe with care.
To whom you speak,
of whom you speak,
and how and when and where.”
The original author of this verse is unknown. It appears to be in common usage in the latter part of the 19th century, as it is quoted in the 1890 Pacific Education Journal. Regardless of who came up with the words, they are good ones to observe.