Is is good idea to quit the job immediately or not ?
In my opinion, it's a bad idea to quit a job without having another job ready.
- The financial pressure of being unemployed can lead you to make decisions you wouldn't otherwise make. You might need to take a less-than-optimal job just to be able to pay the bills. That can lead to job hopping.
- Many employers view quitting a job without another waiting as a sign that work isn't that important to you. Companies like to hire people who treat work as important.
- Sometimes, market conditions turn sour and you could end up unemployed far longer than anticipated. For right or wrong, employers would rather hire someone who already has a job than someone who is unemployed - particularly when the economy is bad and many people are applying for one job. (I'm not saying this is a good thing, just that it happens.)
The counter to all that might be that you could be offered an attractive severance package if you offer to be part of the group being laid off at your company. But that's hard to know for sure, and a risky move.
In general, I have found that you would be far better served by finding your next job, getting an offer and formal acceptance, then handing in your resignation and working out your notice period.