“generation.” See commentary on Proverbs 30:11, “generation.”
“excrement.” The Hebrew word is tsoah (#06675 צוֹאָה), and it means excrement or filth. In this context it most literally means “excrement,” referring to our human bodily waste, as we can see from verses such as 2 Kings 18:27 and Isaiah 36:12, combined with the fact that the “generation” includes both men and women (in Isa. 4:4 tsoah refers to menstrual blood; in Isa. 28:8 it refers to vomit). Further evidence that in this verse tsoah refers to human excrement is that the Septuagint, the Greek translation of the Old Testament made about 250 BC, translated tsoah as exodos, “a going out,” which in this context would refer to excrement.
In biblical times there was no really effective way to cleanse oneself after going to the bathroom. Toilet paper and similar products did not exist, nor did sinks with running water, nor did truly effective soap. Often a person just had to use his or her hand to clean up and then wipe off their hand in the best way possible in their circumstances, and this was the dominant reason that people only ate with their right hand, and cleaned themselves with their left hand (see commentary on Matthew 25:33). When a person with an unclean hand touched his body and clothes, he became much more unclean and covered by excrement than he was aware of. Thus often, just as Proverbs 30:12 says, people who thought they were pure in God’s eyes actually were unwashed and unclean from their excrement.
A number of versions think “excrement” is a hyperbole to exaggerate the impurity that people have before God, and translate the verse a little less extreme, using “filth” or a similar word. While the use of “excrement” in Proverbs 30:12 may be somewhat exaggerated for emphasis, it is also true that in God’s eyes people who are pure in their own eyes but not pure in the sight of God are not just “filthy” in the sense that it would be nice if they took a bath, they have excrement on them and are in dire need of God’s cleansing to be pure and holy in His sight. Of course, the way to be washed in the sight of God is to live a righteous life, and when we sin, repent and confess our sin (1 John 1:9).