Insist that the value of the work in place be more than the amount of money that you have paid out. Don't be the contractor's bank. If they need a loan, suggest they go to a bank. If you can afford to loan them money to carry out their business and for some reason want to do this, then sign a secured loan agreement with them. Otherwise, pay them only after items have been delivered to your place and are under your care and safekeeping.
Reputable contractors have accounts at vendors and they can charge for materials and equipment.
The best arrangement is for you to pay them at stages of the project, and always a little less than the value of the work in place. Thus, if something happens along the way, you always have funds not yet paid out to hire someone else to finish the job. I know this sounds harsh, but unless you have some kind of relationship with the vendor of the service you require that causes you to be willing to risk your money, these are the only ways I know to avoid an inevitable financial disappointment.