When you first get to the apartment complex, take notice of the entrances to the complex itself and individual buildings; and when you leave, do the same thing with the exits. Gates at the entrances to the complex will help deter criminals from committing crimes on the property. At entrance points, gates prevent unwanted people from entering, and at exit points, gates prevent criminals from getting away quickly committing a crime.
Individual buildings within the complex can have security to keep criminals away. It is best if doors on the outside of the building only allow people in who have the correct key, pass code, or the okay from someone inside the building already. These so-called controlled-access doors will reduce break-ins, loitering, and the chance that you will be hurt at the complex.