Software engineers have the privilege of being at or near the top of the food chain when it comes to job mobility.
I follow a very simple rule - if I hate something about my job and it can't be fixed in the mid term, I look a new job. Overthinking this easily leads to burnout and frustration.