I had a similar situation, so I'll tell you my story and let you make your own decision.
The first company I work as a software developer had a complete change of management, then hired hired my boss, 2 other devs, and then me. We worked hard to completely rewrite and even reimagine the +15 year old software suite from scratch. After 3 years, they fired my boss. Six months later, they fired one of the devs they had hired before me, who was also the supervisor. Both were supposedly due to dragging the team down.
So instead of promoting anyone, they hired direct replacements. Around 3 months later, an ultimatum came down to us devs that we had 3 months to do what amounted to 9 months work. They presented it as a "90 day challenge", but not taking this challenge was essentially quitting, even though they didn't say that explicitly. Some of this was work we'd been trying to get management to do, but they focused on new features instead of technical debt and continuing to convert old functionality into the new software.
For me, I'd been getting small raises, yet stellar yearly reviews up to that point, but then I was told I wasn't doing work up to par and needed to pass a performance improvement plan (PIP) to stay employed. This was also exactly the same thing as the ultimatum they presented me.
I knew that I was getting paid $10k less than even a first year dev in that area, so when they only gave me a $1000 raise, I knew it was time to leave, and then the ultimatum on top of that was just more reason to leave. I started looking for a job immediately as well as making a real effort to do the 90 day challenge. That last bit was so they couldn't say anything bad about me after I left, or if they did, I could contest it, if it really even mattered. Also, it was cover for job hunting.
After 90 days, I had completed the PIP with the requirements shifted constantly and considerably, and a new job in hand. The PIP wasn't even to get me a raise to industry standard, just to keep my job, so I took the job that gave me a $17k raise, was less stress, fewer hours, and better management. As they say, "it was a no brainer".
Here's a side bit to show how little they cared I left after 4 years: they gave an exit interview to a guy that left after only 6 months, but not me. They also expected me to work until 5 pm on my last day and only then clean out my cubicle.
If you want to think that my work or attitude had changed causing all this, you'd be slightly correct. When we went from an Agile to waterfall style of management, the management wanted to require lower Planning Poker Points on tasks, less time per task, and more Points per Sprint, of course my attitude is going to change, including my ability to do good work. Not to mention that when I started, the management had a family atmosphere, only to take a sharp corporate change, then tell us devs that the customers hate the software, when they'd been saying it was loved just a month earlier.
We were gaslight by how our software was received by the customers, either by how good it was or by how bad it was, or maybe both. I don't know and I don't care, but it was wrong either way. It was also wrong to blame it on the devs when the sales dept kept selling features that hadn't been decided on, managers deciding what work is done, as well as managers keeping changing the Definition of Done and how the features were supposed to even work or look.
If this sounds like your situation at all, you need to simply find a new job. Yes, I said I'd leave the decision up to you, and it still is, but do you really have a decision when you've been shown by your managers that they don't really care about you?
I'm currently in the job market again and I know how hard it is to find work right now. You probably hear that the job market is flooded right now. Well, that's somewhat true, but the requirements by many employers is unrealistic. From the gargantuan list of skills, technology, and experience they list to the requirement that "remote" means "local", it's pretty difficult to find a new job. I've put in over 300 applications and haven't heard back from many, even with my significant experience and wide range of skills.
Saying that, you should find a new job before leaving your current one. Not only will quitting you job likely disqualify you from getting unemployment benefits, but finding a job is always easier when you already have a job.