Confucius said this quote

When you see a good person, think of becoming like her/him. When you see someone not so good, reflect on your own weak points.