Human beings have contemplated the nature of mind for at least two and a half millennia. As far back as ancient Greece Plato was writing the Meno, a Socratic dialogue that investigated the nature of knowledge and knowledge acquisition and proposed a theory of knowledge that saw it as being innate in the human soul from birth. For Plato knowledge just required the appropriate instruction and logic to bring it to consciousness.
Beyond these early musings not much happened for many centuries until the experimental scientific method was developed. An early example of this was the development of a psychology of visual perception by Ibn al-Haytham in the second decade of the 11th Century AD. But it was not until the Renaissance that the term psychology began to be used, the first instance being in the 16th Century, by the Croatian Marko Marulic, in a work that has since been lost.
The beginning of what we would recognize today as modern scientific psychology did not come along until the 19th Century. It was in 1879 that the German psychologist, Wilhelm Wundt, founded a research laboratory at Leipzig University. Wundt was to become the so-called father of psychology. In 1890 a seminal psychology text was written by the American philosopher, William James. His Principles of Psychology proved to be a foundational document, setting the agenda for the coming decades, and shaping the form that the science would take right up to the present day.
It was also in the 1890s that an Austrian physician named Sigmund Freud developed the method of psychotherapy known as psychoanalysis. This would prove to be one of the most influential theories of any kind during the twentieth century, having a significant cultural impact across the world, and provoking much research and much criticism. But whatever we think of these early theories in the present day, theorists like Wundt, James, and Freud had laid the foundations for the modern scientific study of the mind and the treatment of mental illness.