If the Negro slaves were not able to physically escape their confinement, which most of them were unable to do, they would often escape emotionally by singing. These songs, known as Negro spirituals, served many purposes for the slaves.
First, some of the Negro spirituals included directions and warnings for those who were traveling via the Underground Railroad. If the singers themselves could not escape, at least they could help others do so. One example is "Follow the Drinking Gourd," which includes these lines:
The riverbank makes a very good road.
The dead trees will show you the way.
Second, these spirituals provided comfort to the slaves who had nothing here on earth to look forward to but a continued life of misery. They often sang about a future in heaven in which there would be joy and where they would be reunited with their loved ones--not an insignificant hope to a slave.
Finally, singing these songs served to mask their hopelessness and anger about being slaves. While virtually nothing about their circumstances offered the slaves any hope that their suffering would be lessened, slave owners could often be fooled into thinking the slaves were content. This may have served the dual purpose of preventing worse treatment and allowing the slaves to express their sorrows and anger without being punished for it.
While a physical escape from slavery would have been every enslaved black person's first choice, they usually had to settle for emotional escapes, such as those provided by singing Negro spirituals.