Best way is to get a deposit, or alternatively, weekly progress payments, reducing the loss considerably. The progress payments is done regularly to help SMEs, which can be used as the carrot to get the work done and paid at the same time.

Happened to a friend of mine many years ago with tarred paving.
He always got the municipal tenders cos his price and quality was good, then there was the middle man who got the tender at a higher price the following year, contacted the original supplier to do the work at the price he always quoted. Job got done, Municipality paid the middleman, and he disappeared with the loot. My friend was able to hold onto his house, and lost everything else.