Lay down the conditions
Spend time on your General Terms and Conditions. Make sure that the service you provide is well covered in them. Do not settle for general descriptions but ensure that they are tailor-made. If a dispute arises, the General Terms and Conditions ensure that you cannot be accused of just anything.
In the agreement between you and your client, make clear which obligation you are entering into. An obligation to achieve a certain result is riskier than an obligation to perform to the best of one's ability. Make sure that the General Terms and Conditions are mentioned in the agreement. When you sign the agreement or offer, your client will have taken note of the General Terms and Conditions.