Applying for a new job while you're still employed is a tricky process. It's difficult to know what order you should do things in, especially when a prospective new job wants you to begin as soon as humanly possible. You can risk putting in your two-week notice before you get an offer letter, but that's not very smart. Even if you 100% think you've got the job and just have to sign your offer letter, you should wait until that letter is in front of you and signed before making a rash decision.
One IT worker recently went viral on Reddit for sharing the story of a company stealing and then discarding another company's workers. The shady company would tell their applicant they needed to quit their current job right away so they could start ASAP, and when the applicants did that, the jobs they were applying for suddenly disappeared.