Avoid singularity errors on 6-axis robots

When programming a 6-axis robot arm, I often get singularity errors. What is a singularity, how can I evade them/deal with them?

Answer might also mention tilting robot base 45deg forwards (may solve many singularity errors)