Traveling to Nogales is fairly easy whether you drive a car or walk on foot across the border.
Moreover, you can also use a shuttle service from Phoenix or Tucson (70.8 miles).
Phoenix is 2 hr 51 min (181 miles) away by car if going via I-10 E and I-19 S.
You must have a passport, valid identification documents & entry permit (Forma Migratoria Multiple or FMM) while entering Nogales.
Note: There are separate pedestrian crossings for US and non-US citizens, so choose the correct crossing.