Sociology is the study of the workings of the whole person as the person interacts with society and with others. People are built by others. Their beliefs, values, norms, life experience, knowledge and traumas are at the hands of other people. It is impossible for a human to reach maturity and self sufficiency without a lot of support, so there will be other people, and in some rare cases, animals involved in the formation of each and every human individual.
The mind has physiological capacities that the person is born with, that develop or that may have been damaged at some point in life, and it has capacities that are developed through living, interacting, learning, resolving and experiencing, among other processes.
There is also nutrition, environmental exposure and other facets of nature that can affect the development of the mind. And these factors are either based on the immediate environment, economic and social structures and on cultural and social systems.
There are genetic variations and situations that form the physiology of the whole person. When an entire, closed social group is homogeneous, then more minute physical differences and variations,are the source of differences in treatment. Social standards of beauty, health, and even right to ascend to royal positions of power come into play.
The same variations can cause more profound differences in the way that people are treated in diverse and mixed socieities. Racism, sexism, xenophobia and other problems arise when there are "majorities" and "minorities" and when one or the other has the power to rule over others. Which group is denied opportunity, imprisoned, enslaved or subjected to pogroms and genocide is often based in physical appearance, tribal or other social affiliations and over generations, ongoing caste and class enforcement.
All of these factors and more, including natural and unpredictable disaster, wars, invasions and dysfunction in the home will serve to create a palette of experience, traumas, opportunities and memories that are essential to what kind of mind a person has when they are able to get out into the world and to function on their own.
Much of the time, the human mind is only studied in terms of one individuals intellect, physical illness, mental illness or to find out why an individual is engaging in behavior that is socially unacceptable or intolerable.
While Sociology is not necessarily the best science, it is, more often than not, a necessary science for any program or goal that intends to improve understanding the human mind, whether as part of a social group's collective mind or whether it is the mind of a single individual.