It is practically impossible to explain such a complex theory as Freud's in a few paragraphs, but we can try, though I advise you to read from the reference links for a more comprehensive view.
Freud conceived of human psyche as composed of three parts.
The ID, made up of drives (instincts) and desires, is entirely unconscious and chaotic.
The SUPEREGO harbors parental and societal mandates and prohibitions, and constitutes a "moral" barrier that restrains the ID. According to Freud, it comes into being after the father figure has been internalized and the Oedipus complex has been overcome.
The EGO mediates between the other two parts, allowing the subject to pursue his desires within the boundaries of reality. From it stem defense mechanisms against the "attacks" launched by the ID and the SUPEREGO. Some of it is conscious, and some unconscious.