In Freuds theory of personality

The ego obeys the reality principle

The superego obeys the pleasure principle

The id operates by secondary process

The ego operates by primary process thinking