The immigrants coped with these conditions in two major ways.
First, and less importantly, they often became connected to the political machines that dominated cities in those days. The machines helped to ease the conditions by giving immigrants some amount of material help. In return, the immigrants voted for the machines.
Second, and more importantly, the immigrants created their own communities and organizations. Since they were under stress from the physical conditions and the psychological strains of living in a new country, they went for self-help. They had plays and other entertainment in their own languages. They had little enclaves where everyone spoke their language and had similar customs. They had newspapers printed in their native languages. In all of these ways, they tried to create communities that would help support them psychologically and allow them to cope with the conditions they encountered.