Don't just disappear, because that would get you into a real legal mess. What a lot of people forget is that terminating it unilaterally without following what the contract says could leave your deposit locked up for years, or even end up with the landlord suing you for the remaining months.
You need to go over the contract with a fine-tooth comb and see what it says about the term and whether there's any early termination clause. Some contracts have a penalty (like two months' rent, or whatever) or require 30 or 60 days' notice. Others just lock you in for the full 12 months with no way out. Once you know exactly what that paper you signed commits you to, get in touch with your landlord and explain the situation - that you've got a job offer, the move in September... a lot of landlords understand and prefer to work something out (maybe you pay a smaller penalty, or help find a new tenant) rather than deal with forced terminations and having the place sit empty.
If your landlord is one of those who won't negotiate, you've got the option of finding someone to take over the rest of the contract, though that's got its own legal complications too. The important thing is to document everything in writing. And please, don't try to make your deposit disappear thinking that gets you off the hook: in 2026 it still works the same way it always has, landlords come after you and courts don't hesitate to rule in their favor if you breach it.