The answer to that is the cell membrane. The way that I remember all of the cell parts is through an analogy. Many have been made, but for me the easiest one to understand is a city. It takes a long time to explain all of the cell parts compared to a city, so if you are interested just look up "cell analogy to a city". But the cell membrane can be compared to a gate inside of a city :)