If you need to break your lease and move out early, ideally you can work something out with your landlord; in such cases you'll want to get it in writing, using the Sample Agreement Regarding Cancellation of Lease.
If you can’t get a written release, or if it’s not possible to deal rationally with your landlord, see if you can find someone who will take over your lease. Ask your friends and co-workers for leads. Show your apartment to people who might be interested in taking over your lease. Keep a list of everyone who appears suitable and expresses an interest in moving into your place.
Write a letter to your landlord with the names of potential tenants, and include information that shows that these people are responsible (for example, including something about their job). Use this Sample Letter to Landlord Suggesting Potential Tenants as a model in preparing your own letter. Your landlord has the right to approve or disapprove of whomever you suggest as a tenant, but may not be unreasonable about it.
Keep a copy of this letter for your file, in case you end up with a dispute with your landlord and need proof that you tried to find a suitable replacement tenant.
For more advice on the subject, see Breaking a Lease and Leaving Early.