We can learn a lot from doing a job, even (especially?) when we hate it. It is important to look for what you need to learn. However, it is also important to know yourself and recognize when fear is keeping you in small, unhealthy place because you don't have the courage to jump off the cliff into what you love to do in your life and learn to fly.
I don't know where you are in your work life, but if you are still young, you can be aware that most of us spend time at the beginning doing work we don't like, because we haven't yet figured out what we do like. Keep your hobbies going, keep taking courses and developing your skill set and your own "brand," develop a network of colleagues and people who are doing what you want to be doing, and keep in touch with them. They may turn out to be mentors who can help you along your path.
Eventually the time comes when we have to stop doing what we hate, because it poisons us. When we fill our lives with what we hate and with what is wrong for us, we leave no room, no time, and no passion for what we love and were born for. So if the time is now for you, screw up your courage and quit your job. It's true though, that nothing is life is free, and whatever we do takes dedication, hard work, persistence, and consistently coming back to our personal goal after stepping aside temporarily to deal with distractions.
We were born to serve humanity, to help each other grow, and to teach, love and expand ourselves spiritually. Once you find the way to live your life as a river and not a war, all the rest will follow.