The subscription isn't tied to the computer but to your Microsoft account. You should be able to sign in to https://account.microsoft.com/services , turn off recurring billing (if it is enabled) and then cancel. See https://support.microsoft.com/en-us/office/cancel-a-microsoft-365-subscription-46e2634c-c64b-4c65-94b9-2cc9c960e91b .
For information on refunds, have a look at https://support.microsoft.com/account-billing/how-to-get-a-refund-on-a-microsoft-subscription-67dca30b-b323-44d5-acc2-e02f9902c472 .