Like you, at times, I reached a plateau of motivation, and more than once I questioned the meaning of the job I was doing, unsatisfied and listless.
I think if you are at all introspective, reflective, that it's inevitable you go through patches like this.
You've now got plenty of advice from many with experience, I won't add to that pile. Instead, just briefly, a word on my current situation and outlook.
Working for someone else is only rarely going to be broadly fulfilling. Working for yourself can be worse.
So I developed my hobby interests, most involving programming, because I still love it. I still get excited exploring possible solutions to hard problems. It's fulfilling in a way that working for megaCorp can never be. It's the difference between straining to meet a work deadline and straining to win a game. Similar, but different.
In other words, contentment, for me, comes from within.