I am sorry to learn of your situation.
I am a Qualified Solicitor with over 19 Years experience in the UK.
Unfortunately, you can not simply release yourself from a Tenancy for the reasons under the circumstances you describe.
If you up and leave, then the Landlord will be able to hold you responsible for the remainder of the Rent under the Tenancy as you will be deemed to have Breach the Tenancy Agreement.
The Landlord will in all likelihood be successful in obtaining a Monetary Judgment against you from the Courts, which the Landlord will no doubt progress to Enforcement.
If you can negotiate your way out and agree to say a Deed Surrender (of the tenancy) that would be ideal but I anticipate unlikely.
I note, that there appears to be Disrepair at the Property, this may assist you in vacating the property tactically.
You need to formally write a Letter and demand that the Landlord rectify the Disrepair within 20 days or take suitable steps to do so.
If the Landlord fails to do so, you can make a Housing Disrepair Claim, if the Disrepair will cost more than £1,000 to rectify, then you could instruct a ""No win No Fee" Housing Disrepair Solicitor to pursue a Disrepair Claim against the Landlord.
A quick browser search on the Internet with the term "No win No Fee Housing Disrepair Solicitor" should do the trick. Do not use a Claims Management Company ,they are just middlemen, use a Solicitors Firm Authorised and regulated by the SRA.
The Landlord may be more amicable and ready to negotiate your way out of the Tenancy Agreement settlement if there is a potential Disrepair Claim against the Landlord.
I hope that assist.
Please leave a Positive Rating, so that JustAnswer credits me for my time