People generally get comfortable in their jobs because it becomes their comfort zone, but by doing so, they might be missing out on much bigger and better opportunities.
When you're not working and are looking, you're often desperate and need to find anything suitable for your skills. This gives the employer all the leverage.
But if you're looking while you're already employed, you can ask for much more because you are "in demand." This gives you all the leverage.
And instead of trying to get a salary like your previous one, you can ask for a 10 to 20% increase, or more PTO, or any other benefits related to quality of life.
And if all of this fails, you haven't lost anything, and your situation is the same as it was before you started looking.