This is especially true when it comes to the classes you teach. If you are a new teacher, try to figure out what classes you would love to teach.
You may have to teach a few things you don't like when you are getting started. After a year or two, though, you should be actively trying to persuade your principal to let you teach what you like and do best.
If you don't have any luck getting a schedule that you like after a few years, it might be time to move on. Teaching is challenging enough when you are doing what you are good at. Don't make it worse by working outside your strengths.
If you are principal, I don't think it's rocket science to suggest that your school would be more successful if people were working in their strengths as much as possible.