Open your web browser and browse to
My Account (microsoft.com). Once loaded (you may have to login with your work account) you will be presented with the following screen. Simply click on the Leave organisation option for the organisation you would like to leave. You will then need to confirm by clicking Leave. You may have to restart Teams in order for the changes to take effect.
Please note that you will lose access to any data in the Team stored on the guest tenancy. If you require this data please ensure you back it up first.