The term used to describe a person who thinks they know everything and considers others to be ignorant or foolish is "know-it-all" or "egotist." Such individuals often display an excessive sense of self-importance and have a tendency to dismiss or belittle the opinions and knowledge of others. They may also exhibit an unwillingness to learn from others or consider alternative viewpoints. This behavior is generally seen as negative and can lead to interpersonal conflicts and difficulties in social interactions.