Formally, you don't cancel the contract. Instead you notify the regie of your intent to leave as per date xyz and provide a solvent(!) follow-on renter willing to enter into the contract at your stead. You need to be able to prove their willingness, so do get the contact data of each one.
See here for some templates in German. Sure, most regies will accept a follow-on renter even if you give actual notice because it relieves them from finding one themselves, but they're not obligated to.
That way, if you can't present a solvent follow-on renter, the contract will end at the contractual end date that is equal to, or follows, your date xyz.