I can't figure out why my professor hates me
My answer to your question is, I believe, pretty good advice to follow in general: you should act professionally.

At the end of the day it doesn't matter whether or not your professor likes or dislikes you. If you handle yourself professionally (show up to class on time and prepared, complete your homework assignments to the best of your ability, ask for help when it is needed and interact respectfully with your professors) then you should expect that you will be treated fairly and equitably and should complain if you aren't. 

(I've taught at the college level for more than ten years and have never disliked a student. The worst that happens is that occasionally I'll have a student that I find exasperating -- perhaps they talk over other students in class or consistently show up to class 5-10 minutes late -- but these sort of students pop up so regularly that I can't imagine actively disliking any of them. I have a similarly difficult time imagining a professor actively disliking one of their students barring some sort of (extraordinarily rare) extenuating circumstances.)