You should check your listing agreement carefully. Most agreements will allow for a penalty for withdrawing the listing prior to the end of the contract. These terms should be spelled out clearly in your document.
Real estate agents are not authorized to practice law. The best agents are there for life not just one transaction.
I agree with Boyenga Team, however you did sign a listing agreement.
Listing agreements have expiration date, and if the home seller wants to withdraw prior to end of that listing agreement, than there could be a cancellation fee involved; or the agent might exercises their right to continue to market your property until the end of your agreed listing time.
You are not giving much information in regards to your reason/situation, but if that agent brought a willing and able buyer ,the agent then can exercise his/her right to collect commission if you did not accept that offer and decided not to sell.
If the agent did not represent you properly and you feel that the job was unsatisfactory, then just a thank you for your the time would be sufficient. Then you can interviewing other agents. Good Luck!