Wait until you have your new job offer in writing before you resign from your old job. Give your employer a written notice two weeks before you want to leave. Ask if there is anything you can do to help ease the transition for them during that time.
The goal is to leave on amiable terms so that your old employer will be a good reference for you in the future. Avoid mentioning anything negative in your exit letter.