You do not like your job.
And you want to change it.
But you have spent years doing it.
Won’t all of that go to waste?

That isn’t the right question to ask.
Instead the right question is: “If I don’t make the move I want to make, what about the years ahead that would be wasted?”

The time spent committing a mistake isn’t time wasted.
The realization that it is a mistake stops from getting it wasted ahead.