When a person categorizes someone else as belonging to a certain group based on assumptions, this is called

prejudice, stereotyping

Check those words in a dictionary.

Dictionary.com

When a person categorizes someone else as belonging to a certain group based on assumptions, this is called stereotyping.

Stereotyping is a cognitive process where we assign certain characteristics or traits to individuals based on their membership in a particular social group, such as gender, race, religion, or nationality. It involves making generalizations or assuming that all individuals within a particular group will possess the same traits or behaviors.

To understand that this behavior is called stereotyping, you can rely on knowledge of social psychology. This field of study explores how individuals shape their perceptions and judgments about others based on social categorization and group-based expectations.

If you encounter this term in a written or online source, you can verify the definition by referring to reputable dictionaries, psychology textbooks, or scholarly articles. Additionally, you can conduct a web search using search engines to find reliable sources that explain the concept of stereotyping in more detail.