How did people get to the Nazi Concentration Camps during the Holocaust?

The Nazis forced people onto trains that took them to concentration camps. Sometimes they would take the entire population of a city to the concentration camps at one time.