The best defense is an offense. Try to prevent an issue with a bad contractor before hand.
My personal experience in hiring a contractor is once we agree on a price and scope of work, we put it in writing and we both sign it. I have never done a large job of over 10K. Those type of jobs may require a pay schedule, but I do not suggest it. I do not pay anything until the job is done and we are fully satisfied with the work. If any large purchases are needed for the project such as doors, windows, or flooring, go shopping with the contractor and purchase the big items yourself. If the contractor is decent and had a good track record, they should be able to front the small costs of projects, present you with the receipts, and you reimburse them the materials along with the labor price agreed to.