You can leave a workspace that you're a member of from the Workspace Members page. Click on your profile image on the top right and select your workspace to go to the Workspace Members page.
From this page, click on your name, navigate to the top of the list, and click the "Leave" button.
☝️ Restricted members are unable to access the Workspace Members page. In this case, you can leave the workspace directly from your Profile under the Account tab.