I highly recommend avoiding going to court if you can.
But just in case a court action cannot be avoided you should be prepared.
How soon should you prepare?
Even before you know there is a problem.
By having the right intake and processing systems in place your job will be more than half done should you ever be in a situation where you have to file a claim in court.