what part of the cell controls what goes in and out of the nucleus
The DNA is in the nucleus of a cell, and it controls the functions of a cell ( see central dogma of cellular biology).