The best time to get a very good job offer for yourself is when you are still gainfully employed.

Being employed makes you more confident and relaxed on the interview, thereby giving you ability to negotiate well.

When you are unemployed, you settle because you are desperate.