Now, I feel like I have been demoted at my workpalce, and my career is finished. I am no longer motivated to work anymore. It has been 2 months of joining this new company.
Obviously, your career isn't finished.
What should I do? Should I consider switching to a new company, or swallow my thoughts and give my best ?
If you haven't been giving it your best so far, you should do that.
Otherwise, if you aren't feeling motivated by having your salary doubled, you should either wait until you get put on a new project, or start looking for a new job.
You didn't indicate how long a given project should last. So you might find yourself on a new project in a different role in short order.
But if you feel you can't wait for that, then find a new job and leave this one.
Do a bit of introspection first and find out how you can determine if your next job will make you feel motivated or not before you start the interview process, so you don't end up in the same situation with a new company. For many, money doesn't buy happiness.
Work in startups tends to have a wider scope than in a large, multi-national corporation. In the former, you get to do a lot because there are fewer people to do the work. In the latter, you tend to focus on a narrow batch of work. Perhaps consider this if you decide to move on to a new company.