Thought or thinking is a mental process which allows beings to model the world, and so to deal with it effectively according to their goals, plans, ends and desires.
Thinking involves manipulation of information, as when we form concepts, engage in problem solving, reason and make decisions.
Thinking is a higher cognitive function and the analysis of thinking processes is part of cognitive psychology.
The basic mechanics of the human brain reflect a process of pattern matching or rather recognition.
In a "moment of reflection", new situations and new experiences are judged against recalled ones and judgments are made.
In order to make these judgments, the intellect maintains present experience and sorts relevant past experience.
It does this while keeping present and past experience distinct and separate.
The intellect can mix, match, merge, sift, and sort concepts, perceptions, and experience.
This process is called reasoning.
Logic is the science of reasoning.