Hermann Von Helmholtz measured the neural impulses in a brain while doing certain task and deduced that, even though human senses are prone to mistakes, the mind couldbe measured by science. This marked the discovery of Psychology.
Helmholtz's research didn't answer the question of how the human senses perceived the external material reality. A set of German Researchers including Ernst Weber and Gustav Fechner began researching this study, which was named psychophysics, and it led them to be able to measure the relationship between physical stimuli and human perception which would become the basis for the science of Psychology.
Soon enough, the study of Psychology came to America, however, an American named Titchener found a new study of psychology called Structuralism. Structuralism studied what the brain was rather than how it worked. He believed his main focus should be on adult brains so he excluded children, animals, and those with mental deficiencies from his experiments.
Shortly after the finding of Structuralism, 3 of Titchener's students name William James, G. Stanley Hall, and James McKeen Cattell founded the study of Functionalism. Opposite to Structuralism, Functionalism was interested in what the mind does and how it works. This new study led to the study of animal brains and how they compare to the human brain.
In the middle of the 20th century, Psychology had a breakthrough. A man named Sigmund Freud created psychoanalysis and theorized the three elements of the human brain: Id, Ego, and Super-Ego. Id is the unconscious, primitive behaviors one receives from birth. The Ego is the part of the brain that deals with reality. This means that it decides whether a decision will be beneficial or not. The Super-ego holds all of the moral standards one has learned and uses them to make judgement calls.
In 2018, one of the most popular theories is the psychoanalysis theory by Sigmund Freud. Although some Psychologists theories of the mapping of the brain and how the parts of the brain work together differ from Freud's slightly, the same basic principles of Id, Ego, and Super-ego still apply. Freud's theory has been used in therapy to help released repressed thoughts, experiences, and emotions of the subject. Psychoanalysis may be very close to how our brain actually functions, but most of Psychology is still just a theory.