NEVER "hint around" that you might be leaving. If your employer is considering any cuts, you'll be the first to go. Some other tips:
1. The best time to search for a job is when you have one. You're not under any pressure and won't make most common errors, such as looking desperate.
2. Never let your job search interfere with your current position. Keep it off duty and never schedule an interview that requires you to take time off.
3. Never search for a job from your job or every use your job's resources to prepare and print resumes, etc.
4. When you do get an offer, make sure that they understand that you need to give 2 weeks notice (or whatever is customary locally) at your current job. This is standard practice and no employer worth working for would ever object.
5. Always tender your resignation in writing and give it to your boss personally. Schedule a private meeting with him or her. Your resignation letter should be professional, state that you are resigning as of whatever date, and thank your employer for the opportunity to work there. As far as reasons are concerned, the best reason is specifically vague: "To pursue other opportunities." You don't need to mention your new employer's name and should never put it in the resignation letter. If you do reveal that, do so verbally.
Most employers treat resignations professionally since few employees work for a single company for their entire career.
Be prepared for a possible counter offer. That can get tricky. I've seen cases where an employer countered with a better offer and then let the employee go a few weeks later once the other job had been filled and was no longer available. That's petty and mean spirited but it does happen. I've also seen counter offers work out well and have had that experience myself, with more pay, more responsibility, more interesting work, etc.