Being in a job you hate is (depressingly) common. Does that mean you should hang around because, you know, everyone is in the same boat? Here's a question then: even if you were in a job you liked, would you want to do it everyday until you retired? I'm assuming here, but I would answer that by saying no, you wouldn't want to. Very, very few of us find ourselves in a role that we absolutely love and couldn't think of ever doing anything else. For the rest of us, we're hoping for a promotion, or to get on that new project, or change to another department, or get that qualification and shift to another career, or any of a myriad of other possibilities. Heck, sometimes our next career goal isn't clear, but we know we don't want to be stuck 'here' forever.
So my next question then becomes: if you want to move up, move over, or move on to another role, what do you do about it? Sure, you could keep your head down, do your work, and see what pops up. Sometimes that's enough, but it's certainly no guarantee. So eventually we're motivated enough to work towards it. Motivation is the key here, and you can see where I'm going with this. You use your motivation, whether that's striving to be the best you can be at your role, seeking out opportunities to improve how you work, starting up an online course, doing night school, sending out your resumé, networking, etc. And sooner or later you'll progress to another role, wherever that may be, and however you may get there. Our motivation colours our glasses rose, puts a smile on our faces, and gives us strength and determination.
So what about the original question? What if you're in a job you hate? Well, for one, you need to be asking what aspects of it make you hate it, and maybe taking specific action against anything inappropriate. Another thing is to bring it back to motivation to move on to the next stage - you might not be able to leave straight away, but come on, even in a job you'd like, eventually you would have been looking for the next opportunity. It's just that now the motivation is a lot stronger to get started. That motivation is going to get you through every day.