Microsoft 365 features that help users manage their subscriptions, account settings, and billing information.
If you are unable to access the account that the Microsoft 365 subscription is registered to, then you will not be able to cancel the subscription yourself, you will need to contact Microsoft Support directly to ask them to cancel the subscription.
Before you do cancel the subscription, to avoid data loss, if you use OneDrive to sync your files online, you will loose access to that OneDrive storage, you first need to ensure you have disabled 'Files on Demand' in OneDrive settings and wait for your files to be synced back to your PC to ensure you have a local copy of all your files.
Then, try using this method to contact their support to ask them to cancel the subscription.
Go to this link: https://support.microsoft.com/contactus
Select Microsoft 365
Click 'Get Home Support'.
In the box provided, type billing.
Press Enter, then on the next page, scroll down and click 'Sign in to Contact Support'.
Navigate to Microsoft 365 and Office - Manage my Subscription.
Select the 'Chat with support agent in web browser' option