It is a constant battle - some things that have worked for us are:
1. Get your invoices out promptly - and on domestic have seven day payment terms (just having this on the invoice will mean you get paid faster)
2. Get their email address and email invoices - often they will pay immediately while at the computer
3. Chase every debt no matter how small - it's your money - you earned it. Try to get hold of the customer at home first or on their mobile. If they don't return calls ring them at their work. Leave a message with the receptionist if you have to saying its about an overdue debt (this one is particularly effective).
Ensure you have terms and conditions that state payment requirements and allow you to go to debt collection if necessary with costs passed on to customer.
I haven't found people not paying to be a problem (apart from commercial jobs where they are taking us right to the last day of the month). Emailing invoices has worked a treat and often resulted in 24 hour turnaround of payment. Get all the information you can from the customer before doing the job e.g. phone number, mobile, email address etc. We tend to have customers by referral and stick to our regulars - the ones we know. Often the initial call if they don't pay is along the lines of - is everything ok - do you have a problem with the job etc.
My biggest headache is retentions - and after the Mainzeal fiasco I am keen to see Govt implement some legislation around it.