The ancients chose names based on the content of classics. For example, the Book of Songs is the most cited, or the Analects of Confucius, Spring and Autumn Annals, etc.
There was a famous scholar in the Song Dynasty named Han Gang, whose courtesy name was Yukun, which quoted from the "Thousand-Character Classic" "Gold is born from Lishui, and jade comes from Kungang." Such a name seems stylish, and Very meaningful.
In fact, this is the same as when we look up a word in the "Xinhua Dictionary" and then name our children based on its meaning, but ancient people paid more attention to it.
Another option is to name the child based on his five elements. If the fortune teller says that the child is destined to be short of water, then he will add the Chinese character for water when choosing her first name.
The theory of the Five Elements was very important in ancient times and was included in the Confucian school. Confucianism has a history of more than 2,000 years in China and has a profound impression on them.
The last one is that they will give their children a nickname, which is very sloppy and must appear very humble, because the ancients believed that only in this way can they make a living easily, otherwise they will die young.