An unpleasant experience with one person from a certain group of people can make us prejudiced against the whole group. And against all the individual people in that group. As long as that only happens in your head, it is not much of a problem.
Prejudices are the ideas and opinions that you have developed in your head about certain groups, such as men and women, and people with a different skin colour or religion. As long as you do not express your prejudices and as long as you do not act on them, nobody will notice them.