I've learned to appreciate my job for what it is, and for the benefits that it provides in comparison to other jobs that I could easily obtain. It took me almost a decade of bouncing from a few different jobs, and failing miserably at trying to run my own company, before I found my current job. My job isn't perfect, but no job is. I'm board and eager to move to another opportunity, but that opportunity will be chosen…
This is what it boils down to, imo. Currently I'm working on a horrendous legacy code base with a very low performing team, in a very low performing organization. Over the years I've learned what matters to me, and this job has what I need: good pay, time off, and I can come and go as I please so long as I'm here for "core" hours (ie on location, not remote). The last part is another way to say my boss is cool. He's new too, although he's been here longer than I have. We're both dismayed at the do nothing culture, and terrible code here.
That's about all anyone can ask for IME, find out what matters to you and optimize for that. When I go home I don't give a thought for work, I get to concentrate on my family 100%.