The three parts of psychoanalytic theory are the id, the ego, and the superego. These three parts of the psyche are said to function together to create a living, acting human being.
The id is comprised the primal and necessary urges that exist inside human beings from birth. This includes hunger, thirst, sex drive, and even violence and fear when a person is threatened.
The ego is the part of one's self that deals with reality and allows us to control our urges in ways that are appropriate to society. For instance, a person may feel hunger or sexual desire, but a decent person will not satisfy that urge until they obtain transnational consent from a vendor of food or a prospective sexual partner. Without going through the channels dictated by society and our collective morality, obtaining these things would be considered criminal and morally reprehensible. The ego's purpose is to mediate between the id and reality.
The superego serves as an intellectual evolutionary tool, holding the subconscious morality and higher ideals that are ingrained in us by all that came before. Our most ideal selves exist within the superego.
In the case of "The Cask of Amontillado," psychoanalysis can be applied to the two characters. Montresor's luring of Fortunato into the cellar can be seen as the temptation of the id to act on ones basest desires, whereas Fortunato can be seen as a fool who gives into these desires, in this case to his death.
Montresor even seems to feel some form of love for the fool and often gives him chances to turn around and escape his terrible fate. This can be seen as the ego intervening to stop Fortunato from what will surely be his doom. Fortunato has a clear propensity for alcoholism, meaning that over the course of his life, he has heeded the urges of his id recklessly, and the resulting diminishing returns on his sense of pleasure have clouded his judgement.