A cognitive bias is a mistake in reasoning, evaluating, remembering, or other cognitive process, often occurring as a result of holding onto one's preferences and beliefs regardless of contrary information.
Psychologists study cognitive biases as they relate to memory, reasoning, and decision-making.
Many kinds of cognitive biases exist. For example, a confirmation bias is the tendency to seek only information that matches what one already believes. Memory biases influence what and how easily one remembers. For example, people are more likely to recall events they find humorous and better remember information they produce themselves. People are also more likely to regard as accurate memories associated with significant events or emotions (such as the memory of what one was doing when a catastrophe occurred).
The difference between bias and stereotype is that a bias is a personal preference, like or dislike, especially when the tendency interferes with the ability to be impartial, unprejudiced, or objective. On the other hand, a stereotype is a preconceived idea that attributes certain characteristics (in general) to all the members of class or set.
If you think that all Asians are smart, or white men can't dance, that is a stereotype. But if you hire an Asian for a job that also has an equally qualified black applicant because you think blacks are not as smart as Asians, you are biased.