self-righteous
Describes a person or attitude that assumes one's own views and actions are always correct, often with a negative connotation of being smug or unwilling to listen to others.
I'm fed up with his self-righteous attitude.
You should listen to others' opinions without being self-righteous.