How to terminate the principal-agent agreement?

According to the contract, the agency contract can be terminated.

Contract law of the people's Republic of China

Article 410 The principal or the agent may terminate the entrustment contract at any time. If the termination of the contract causes losses to the other party, it shall compensate for the losses except for reasons not attributable to the parties.