Read the section on how to cancel (or change conditions or give notice)
follow those 'agreed' conditions.
Otherwise, it is a case of going to the editor and asking to cancel (nicely) and accept that the editor may have additional costs in finding someone else to do it - and 'you' may have to pay those extra costs ("damages"). The editor should not be the one to suffer.
if you can find a suitable replacement, then that will make life a lot better when bring the bad news.
Suffer the stated consequences in the contract. That is what a contract is for.
Sorry but, you can't cancel a contract with satan