Even contracts that are beautifully, tightly written by the best legal experts don't fully protect you from legal trouble. Someone who wants to breach the contract and con you is going to do so regardless of what you put on paper. So, the simple presence of the document is no guarantee everybody will behave. And it's not unusual for companies to drop cases when they're in the right, simply because the cost of the fight exceeds the cost of what's owed. Scammers know that, and they milk it.
Beyond your contract, read reviews and get recommendations. All too often, people don't check out prospects because they're swept away by the excitement of the opportunity, feel compelled to move fast to compete, or get suckered by the suave personality of the scammer. If a hiring manager gets references as a matter of standard, so should you.
Then, set up deposits and milestones. Deposits show a good faith intent to move forward. Milestones allow you to get paid or make a payment when you reach a certain point in a project. If the relationship starts to go south, you won't be out everything.