It heavily depends on the kind work and the clients you target and accept.
* always demand partial payment up front (usually 20-50%, depending on contract size and length)
* set milestones with additional payment required upon completion (for bigger jobs)
* have a contract that only transfers usage rights and copyright upon final payment
You can always get screwed over or have bad luck (client goes bankrupt, ...), but some prudence in selecting work goes a long way.
When starting, I learned to stay away from anything gambling and real estate related.